in reply to How to parse this file

hervebags:

I'd do it something[1] like this:

my @cols_to_keep = (0, 2, 3, 5, 6, 8 .. 18); while (my $line = readline(ARGV)) { my @fields = split /\s+/, $line; print FILE2 join(" ", @fields[@cols_to_keep]), "\n"; }

[1] i.e., untested, etc.

...roboticus

When your only tool is a hammer, all problems look like your thumb.