PERL one-liner to unwrap text

One of the perennial annoyances when moving between file formats is the dealing with the way in which some editors wrap text. I sometimes receive files that I need to un-text-wrap. Here’s a handy PERL one-liner that has been useful in reversing text wrapping:

perl -ane 'chop;print "\n\n" if(/^\s*$/); map{print "$_ ";}@F;' /path/to/input/file

Be the first to comment

Leave a Reply

Your email address will not be published.


*