Skip to main content

You are here

Perl - Remove all blank lines from a file

Remove all blank lines from a file using Perl:

perl -ne 'print unless /^\s+$/ ' test.txt

Premium Drupal Themes by Adaptivethemes