# open the input and output files open( my $in_fh, '<' ... open( my $out_fh, '>' ... # operate on a single line at a time rather than reading the # input file in all at once (more memory-efficient if the # input file is very large) while( my $line = <$in_fh> ) { # skip the line if it contains only white space, # otherwise print it to the output file next if $line =~ m/^\s*$/; print $out_fh $line; } close $in_fh; close $out_fh;
In reply to Re: Removing white-lines...
by bobf
in thread Removing white-lines...
by pyro.699
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |