rubysecurity.org

Anecdotes from a Linux Systems Administrator. /root

Home About Books Blog Portfolio Archive
4 October 2014

Perl - Remove all blank lines from a file

by Alpha01

Remove all blank lines from a file using Perl:

perl -ne 'print unless /^\s+$/ ' test.txt 
Tags: [ perl ]