in reply to Perl script to find particular string and save those lines in another file?
(Also, it's better to do it like this:
(updated to "use strict" and add "my" for the one variable)use strict; my $find = "2"; open( NEW, ">", "new.txt" ) or die "..." open( FILE, "<", "high_fanout.txt") or die "..." while (<FILE>) { print NEW if ( /$find/ ); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Perl script to find particular string and save those lines in another file?
by sumathigokul (Acolyte) on May 05, 2015 at 06:11 UTC |