use warnings; use strict; my $count = 0; my $filename = "file0.csv"; open (DISTLISTS, " < rdy.csv") || die "Unable host file for splitting: + $!."; while (<DISTLISTS>) { chomp $_; if ( ($. - 1) % 200 == 0) { # modular arithmetic $count ++; my $filename = "file$count.csv"; open (OUTPUT1, " >$filename") } print OUTPUT1 "$_\n"; if ($. % 200 == 0) { # modular arithmetic close OUTPUT1; } }
In reply to Re^3: parsing lists
by tphyahoo
in thread parsing lists
by natty_dread
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |