Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: How to parse this file

by roboticus (Canon)
on Oct 19, 2011 at 14:53 UTC ( #932427=note: print w/ replies, xml ) Need Help??


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.


Comment on Re: How to parse this file
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://932427]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (10)
As of 2014-10-01 09:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (392 votes), past polls