in reply to splitting up data...
If it's an assignment, they might not want you to rely too much on a specific module.
It *sounds* like you want to do the following:
Here's some (untested) code to help you with the first 2 steps:
open(IN, $ARGV[0])||die "Cannot open $ARGV[0]:$!\n"; die "No number of lines\n" unless($ARGV[1] =~ /^\d+$/); my $lines = 0; $lines ++ while(<IN>); close IN; print "lines per output file = " . int($lines/$ARGV[1]) . "\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: splitting up data...
by chinamox (Scribe) on Oct 22, 2006 at 01:56 UTC |