Help in using VI


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Help in using VI
# 1  
Old 03-28-2011
Help in using VI

Im blanking on how to do this. I have a file im editing in the vi but i can not get my output to be just in one column. exp:
I want this line to look like this.
I
Want
this
line
to
look
like
this.

Please help, I thought it was using the tr but im doing something wrong.
# 2  
Old 03-28-2011
Code:
:s/ /<Control-V><Control-M>/g

# 3  
Old 03-28-2011
Code:
 cat <file> | tr ' ' '\n'

1.txt
I Want this line to look like this.

[******@******** home]$ cat 1.txt | tr ' ' '\n'
I
Want
this
line
to
look
like
this.
# 4  
Old 03-29-2011
Just building on the previous response

tr " " "\n" <test.txt
 
Login or Register to Ask a Question

Previous Thread | Next Thread
Login or Register to Ask a Question