View Single Post
Old 07-31-2003, 05:01 PM  
NetRodent
Confirmed User
 
Join Date: Jan 2002
Location: In the walls of your house.
Posts: 3,985
Save your money. The following should do what you want. I didn't try running it so there may be typos.

Code:
$input_file = '/path/to/input/file';
$output_file = '/path/to/output/file';

open(I,"<$input_file") || die "Cannot read $input_file: $!\n";
open(O,">$output_file") || die "Cannot write $output_file: $!\n";
while(<I>) {
   chomp;
   $_ =~ s/^\s+//;
   $_ =~ s/\s+$//;
   if(length($_) hahahaha 7) {
      print O $_."\n";
   }
}
close I;
close O;
__________________
"Every normal man must be tempted, at times, to spit on his hands, hoist the black flag, and begin slitting throats."
--H.L. Mencken

Last edited by NetRodent; 07-31-2003 at 05:17 PM..
NetRodent is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote