Doesn't deal with your naming but that should be easy to add.open BIG, 'big_file'; my $i = 1; while (<BIG>) { open OUT, ">outfile_" .$i++; #BUG: see follow up below. if ( m/^\$\n$/ ) { close OUT; open OUT, ">outfile_" .$i++; next; } print OUT; } close OUT;
PS. if you intend to create 22000 files you should probably put them into subdirectories, not all in one directory.
--tidiness is the memory loss of environmental mnemonics
In reply to Re: Splitting long file
by EvdB
in thread Splitting long file
by Micz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |