karavay has asked for the wisdom of the Perl Monks concerning the following question:
open (FILE, '1.dat') || die "$!"; $num=0; while ($line=<FILE>) { $num++ if $line =~/AZII*/; if ($line=~/AZII*/ .. /AZII*/) { open (DES, ">>out/$num.txt"); print DES $line; } if ($num == "5"){ # process 5 files only last; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: File Extraction - Cont...
by graff (Chancellor) on Sep 26, 2007 at 02:44 UTC | |
by karavay (Beadle) on Sep 26, 2007 at 03:09 UTC | |
by karavay (Beadle) on Sep 26, 2007 at 03:19 UTC | |
|
Re: File Extraction - Cont...
by CountZero (Bishop) on Sep 26, 2007 at 05:57 UTC | |
by apl (Monsignor) on Sep 26, 2007 at 09:46 UTC | |
|
Re: File Extraction - Cont...
by jdporter (Paladin) on Sep 26, 2007 at 05:02 UTC |