LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   How to put every word in a new line in a file (http://www.linuxquestions.org/questions/linux-general-1/how-to-put-every-word-in-a-new-line-in-a-file-704475/)

SentralOrigin 02-13-2009 12:39 PM

How to put every word in a new line in a file
 
I have a file with a bunch of words in it, separated by a single space. How do I make each word go on a separate line for each one and remove the spaces?

theNbomr 02-13-2009 12:53 PM

Code:

sed -i s/\\s/\\n/g filename.txt
--- rod.


All times are GMT -5. The time now is 01:41 PM.