I need to read in a file of 200 lines and print each out to a separate
file.
I've been stumbling with this, but I don't know how to name each outfile
individually. I was hoping to see 200 files named tx1 - tx200, but
instead I get tx1234..................... for 123 files and then it dies.
Help?
==
#!/usr/bin/perl
use strict;
use warnings;
my $i = 0;
my $outfile = "tx";
open( INFILE, "speed_test.csv" );
while( <INFILE> ) {
open( OUTFILE, "> $outfile" );
print OUTFILE "$_\n";
close OUTFILE;
$outfile = $outfile.$i++;
}
==
------------------------------------------------------------------------
Charles Farinella
Appropriate Solutions, Inc. (www.AppropriateSolutions.com)
[email protected]
voice: 603.924.6079 fax: 603.924.8668
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/