#!/usr/bin/perl while(<./*.txt>){ print "working on $_\n"; open (FH, "+<$_") or die "can't update $file: $!"; $l=$_ while <FH>; truncate FH, tell(FH) - 1 if $l =~ /^$/; }
In reply to Re: truncate only a last blank line
by smokemachine
in thread truncate only a last blank line
by hj4jc
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |