in reply to Splitting long file
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Splitting long file
by matija (Priest) on Apr 08, 2004 at 11:39 UTC | |
by EvdB (Deacon) on Apr 08, 2004 at 12:42 UTC |