![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| cut last line of a word | bullz26 | Shell Programming and Scripting | 2 | 03-18-2008 08:42 AM |
| Read line by line not word by word | vadharah | Shell Programming and Scripting | 6 | 03-02-2008 11:29 AM |
| how to move word by word on command line | pbsrinivas | UNIX for Dummies Questions & Answers | 1 | 11-23-2007 03:17 AM |
| Need to replace the first word of a line if it occurs again in the next line(shell) | geeko | Shell Programming and Scripting | 1 | 09-25-2007 07:15 AM |
| Can a shell script pull the first word (or nth word) off each line of a text file? | tricky | Shell Programming and Scripting | 5 | 08-17-2006 03:29 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
put each word in new line - sed or tr
Hello !
I have a result of ls command in a file: file1 file2 file3.out file4.pdf file5 they all are separated by space. I need to put them on a separate line example: file1 file2 file3.out file4.pdf fil35 i tried sed 's/ /\n/g' inputfile > outputfile but did not help also tried tr command but no result. Please help. thank you. |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
tr should work. use this
Code:
tr ' ' '\n' < file |
|
#3
|
|||
|
|||
|
To add newline using SED use this
Code:
sed -f script file script ################ s/ /\ /g ################ |
|
#4
|
|||
|
|||
|
Thank you
thank you.
that was very helpful. |
|||
| Google The UNIX and Linux Forums |