I want to use
sed to look for spaces in text and when find one move the next word to the next line.
I used:
sed 's/ /\n/g' out > new
However when there is more than one space between two words it adds more lines between them. And I just want the words to be one under another. How can I change that?
Thanks
I find out how to do this:
sed '/^$/d'
However when I'm using emacs and put this two commands in one line they don't want to work:
#! /bin/bash
sed 's/ /\n/g' |
sed '/^$/d' out > new
What I'm doing wrong???