Vineet Pande am Mittwoch, 17. August 2005 12.53: > Hi: > > In the following perl script, I would like to print all the lines in a file > (mdout_short.txt) to temp.txt which have "NSTEP" as a word: > > ************************************************ > use strict; > use warnings; > > my $mdout_file = "mdout_short.txt"; > > my $mdout_xtemp_file = "temp.txt"; > > > open IN, $mdout_file or die; > open OUT, ">> $mdout_xtemp_file" or die; > > > while (<IN>) > > { > > print OUT ( $_ =~ ( / NSTEP/ ))
print OUT $_ if /NSTEP/; > } [...] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>