http://qs321.pair.com?node_id=1125672


in reply to Re: Perl script to find particular string and save those lines in another file?
in thread Perl script to find particular string and save those lines in another file?

Thank you, this code works.

use strict; my $find = "2"; open (NEW, ">", "new.txt" ) or die "could not open:$!"; open (FILE, "<", "high_fanout.txt") or die "could not open:$!"; while (<FILE>) { print NEW if (/$find/); } close (FILE); close (NEW);
  • Comment on Re^2: Perl script to find particular string and save those lines in another file?
  • Download Code