in reply to Help with splitting one text file into other text files
How about:
my %handles; open $handles{ $_ }, '>', "sec.$_" for 1996 .. 2010; while( <> ) { m[^(\d{4})] and print { $handles{ $1 } } $_; } close for @handles;
That assumes that the date is the first four characters of the record; and all the dates are in the range specified.
|
|---|