perl -i.bak -ne 'print if /\S/' file.txt
Seems a bit more intuitive to me :)
Cheers,
Ovid
Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.
In reply to (Ovid) Re: One-liner removes whitespace-only lines from text file
by Ovid
in thread (code) One-liner removes whitespace-only lines from text file
by ybiC
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |