Think about Loose Coupling | |
PerlMonks |
Re: Re: Re: Making my file all one lineby ehdonhon (Curate) |
on Jun 06, 2003 at 10:39 UTC ( [id://263638]=note: print w/replies, xml ) | Need Help?? |
Yup. Good point. perl -pe 'chomp; s/(\S)\s*$/$1 /;' fileThe other thing I failed to mention is if you actually want to alter the file and not just dump to the screen, you would want to run 'perl -pi -e'. Update: jmcnamara msg'ed me and correctly pointed out that my previous regexp didn't work at all, and if it did it would have also created one space for every blank line. :(
In Section
Seekers of Perl Wisdom
|
|