Here is a portion of my perl script:
my $input = 'C:\Documents and Settings\CheplakM\My Documents\Stk 6.0\STK scripts\anad1_matt.txt';
my @output;
open (FILE, "$input");
my @array = <FILE>;
for (@array) {
my ($col1, $col2, $col3, $col4, $col5, $col6, $col7, $col8) = split(/\s+/, $_);
my $line = "$col1 $col4 $col5 $col6 $col7";
if ($line=~m/^\d/) {
push (@output, $line);
}
}
Currently I'm extracting certain columns from the original matrix (col1, and col4 through 7). I now need to extract certain rows. I want the first row, the sixth row, then the eleventh row, etc. There are about 150,000 rows. I need to know what statement is required to extract the first row followed by an increment of 5. I'm assuming this statement would come right after the statement "my $line = "$col1 $col4 $col5 $col6 $col7";
Thanks
my $input = 'C:\Documents and Settings\CheplakM\My Documents\Stk 6.0\STK scripts\anad1_matt.txt';
my @output;
open (FILE, "$input");
my @array = <FILE>;
for (@array) {
my ($col1, $col2, $col3, $col4, $col5, $col6, $col7, $col8) = split(/\s+/, $_);
my $line = "$col1 $col4 $col5 $col6 $col7";
if ($line=~m/^\d/) {
push (@output, $line);
}
}
Currently I'm extracting certain columns from the original matrix (col1, and col4 through 7). I now need to extract certain rows. I want the first row, the sixth row, then the eleventh row, etc. There are about 150,000 rows. I need to know what statement is required to extract the first row followed by an increment of 5. I'm assuming this statement would come right after the statement "my $line = "$col1 $col4 $col5 $col6 $col7";
Thanks