in reply to Looking for a good way to split a file into equal sized arrays

Hi Luken8r,

The flop flop operator maybe worth considering here.

Have a look at Flipin good, or a total flop? for some inspiration.

  • Comment on Re: Looking for a good way to split a file into equal sized arrays

Replies are listed 'Best First'.
Re^2: Looking for a good way to split a file into equal sized arrays
by Luken8r (Novice) on Nov 26, 2007 at 16:12 UTC
    That flip flop solution looks like it may work out pretty well for me.
    my $infile = <STDIN>; print"Your input file is $infile\n\n"; my $outfile = "out.log"; open (INFILE, "<$infile")||die "no such file"; open (LOG, ">$outfile")||die "no such file"; while (<INFILE>) { if (/^Begin Targets/ .. /^End Targets/) { next unless /^\d/; push @data, [split /\s/]; } count++; }
    Im back on my way, thanks!