HI
I am using the below script to create a file with 10000 iterations. What i want to do is, use a loop that would create a file with 1000 iterations for the 10000.
So basically i would like to break up the file with 10000 iterations using a loop to have 10 files with 1000 iterations each. It might be easy to implement, but i am still new to perl.
Any help is appreciated.
use strict;
# These are the configurations that you requested
my %config = (
field1 => 204041000000001, # The value that field 1 should start at
iterations => 10000, # The number of iterations
filename => 'events_27.dat' # The path to the data file you are creating
);
open (DATAFILE, ">$config{filename}") || die ("Cannot create file");
for (1..$config{iterations}) {
# Choose a random entry from the alpha array
# Print the standard data with the changing configurations
print DATAFILE "$config{field1},apn,pdp-context-error,,27,200912090900123\n";
# Increment the changing fields
$config{field1}++;
}
close (DATAFILE);
I am using the below script to create a file with 10000 iterations. What i want to do is, use a loop that would create a file with 1000 iterations for the 10000.
So basically i would like to break up the file with 10000 iterations using a loop to have 10 files with 1000 iterations each. It might be easy to implement, but i am still new to perl.
Any help is appreciated.
use strict;
# These are the configurations that you requested
my %config = (
field1 => 204041000000001, # The value that field 1 should start at
iterations => 10000, # The number of iterations
filename => 'events_27.dat' # The path to the data file you are creating
);
open (DATAFILE, ">$config{filename}") || die ("Cannot create file");
for (1..$config{iterations}) {
# Choose a random entry from the alpha array
# Print the standard data with the changing configurations
print DATAFILE "$config{field1},apn,pdp-context-error,,27,200912090900123\n";
# Increment the changing fields
$config{field1}++;
}
close (DATAFILE);