Here are some variations:perl -00 -pe 's/ $/\012/ if s/\n+/ /g and eof' file
Choose eof or eof() to get the desired effect when dealing with multiple files.perl -00 -pe '(eof) ? s/\n\n/\n/ : s/\n+/ /g ' file perl -00 -pe 's/\n+/(eof) ? "\n" : " "/eg ' file
--
John.
In reply to Re: Making my file all one line
by jmcnamara
in thread Making my file all one line
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |