Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: replace/substituion 4th field

by BillKSmith (Chaplain)
on Feb 20, 2013 at 13:58 UTC ( #1019784=note: print w/ replies, xml ) Need Help??


in reply to replace/substituion 4th field

Use perl runtime options. Specify input file on command line. Redirect output to a file with your shell.

#!perl -p use strict; use warnings; my @fields = split /,/; $fields[3] = $fields[3] > 310 ? 'volmed' : $fields[3] == 70 ? 'volmedl': $fields[3] ; $_ = join ',', @fields;
Bill


Comment on Re: replace/substituion 4th field
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (12)
As of 2014-08-27 20:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (252 votes), past polls