Captainrave
Technical User
Hi have this script:
Basically it reads a list of data in the following format:
AAAAAAA 100 200
TTTTTTTTTTT 211 300
If I set the paparmaters at 5 for example it will only output the numbers following 5 letters or more. I run this 15 times individually parameters of 5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20 by changing the command:
perl myscript.pl n input.csv > output.csv where n is the modified parameter.
Is there a way to automate this script rather than me running it individually 15 times? As you can imagine it is incredibly time consuming!
Many thanks for any input!
Code:
use strict;
use warnings;
use Text::CSV_XS;
my $len = shift;
my $csv = Text::CSV_XS->new();
while (<>) {
$csv->parse($_);
my ($string, $num, $num2) = $csv->fields();
print "$string,$num,$num2\n" if (length($string) >= $len);
}
Basically it reads a list of data in the following format:
AAAAAAA 100 200
TTTTTTTTTTT 211 300
If I set the paparmaters at 5 for example it will only output the numbers following 5 letters or more. I run this 15 times individually parameters of 5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20 by changing the command:
perl myscript.pl n input.csv > output.csv where n is the modified parameter.
Is there a way to automate this script rather than me running it individually 15 times? As you can imagine it is incredibly time consuming!
Many thanks for any input!