How to add space in between columns in VI editor


 
Thread Tools Search this Thread
Operating Systems HP-UX How to add space in between columns in VI editor
# 1  
Old 05-06-2005
How to add space in between columns in VI editor

Hi,
I am trying to add space after 3rd and 6th column for editing a file in special format. How should I achieve in VI?. So, is it possible to do in it in sed ?

thanks
vipa
# 2  
Old 05-06-2005
it can be done in either, but would be more easily acomplished with awk:
Code:
awk '$3=$3" ";$6=$6" " { print $0 }' file

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Columns in textfile merged, how to add space inbetween? (coordinaates)

Hello! I have a problem with a text file containing atom coordinates. After a converting step using some software, the structure of the textfile got a little messed up. Some columns merged, because the numbers got too large. My text file has 119’000 lines like: POPC 1.00 0.00 C ... (3 Replies)
Discussion started by: chem_wizard
3 Replies

2. Shell Programming and Scripting

Evaluate 2 columns, add sum IF two columns satisfy the condition

HI All, I'm embedding SQL query in Script which gives following output: Assignee Group Total ABC Group1 17 PQR Group2 5 PQR Group3 6 XYZ Group1 10 XYZ Group3 5 I have saved the above output in a file. How do i sum up the contents of this output so as to get following output: ... (4 Replies)
Discussion started by: Khushbu
4 Replies

3. Shell Programming and Scripting

Evaluate 2 columns, add sum IF two columns match on two rows

Hi all, I know this sounds suspiciously like a homework course; but, it is not. My goal is to take a file, and match my "ID" column to the "Date" column, if those conditions are true, add the total number of minutes worked and place it in this file, while not printing the original rows that I... (6 Replies)
Discussion started by: mtucker6784
6 Replies

4. Shell Programming and Scripting

Columns to rows with space

Hi, My input is in the following way a b c d e f I would like to have it printed as a b c d e f Any awk scripts are appreciated. (1 Reply)
Discussion started by: jacobs.smith
1 Replies

5. Shell Programming and Scripting

In vi editor I want to replace next line char by space

in vi editor I want to replace next line char by space help me eg: input: 123 123 123 output: 123 123 123 (5 Replies)
Discussion started by: RahulJoshi
5 Replies

6. Shell Programming and Scripting

Single command for add 2 columns and remove 2 columns in unix/performance tuning

Hi all, I have created a script which adding two columns and removing two columns for all files. Filename: Cust_information_1200_201010.txt Source Data: "1","Cust information","123","106001","street","1-203 high street" "1","Cust information","124","105001","street","1-203 high street" ... (0 Replies)
Discussion started by: onesuri
0 Replies

7. Linux

Space bar issue in Vi editor on Linux - Solaris

Hi I have a process generating a file in Solaris. Now we have migrated the process to Linux. When we open the file in vi on solaris and hit space bar, it stops after reaching the end of line. But in linux it continues to go on the next line. So I want to know whether the difference is between the... (4 Replies)
Discussion started by: sudhamacs
4 Replies

8. Shell Programming and Scripting

help with delimiting columns with a space

Hi all, i am writting a script to fix some problems we have with data that we need that contains 1000s of records. I have a text file with 3 columns of data. The problem is there should be a space between the end of the first column and the start of the second column. The majority of the data is... (7 Replies)
Discussion started by: borderblaster
7 Replies

9. UNIX for Dummies Questions & Answers

Removing columns of a file using vi Editor

Hi Experts, I have a file which looks like in this way 1 2233|A.K Shukla |G.M |Sales |12/12/52|6000 2 9876|Jai Sharma |Director |Production |12/03/50|67000 3 5678|Sumit Chakarborty |D.G.M |Marketing |19/04/43|6000 4 2365|Barun... (2 Replies)
Discussion started by: DilipPanda
2 Replies

10. Shell Programming and Scripting

Trying to space columns in a report

I have a program that calculates shipping cost for an item and prints the information to a file. I cannot seem to get the lines to print with equal spacing in columns. I need data like this to be aligned into columns: Optical Mouse 5 A $25 Compaq Presario 3... (2 Replies)
Discussion started by: turbulence
2 Replies
Login or Register to Ask a Question