Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: replace/substituion 4th field

by BillKSmith (Deacon)
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 drinking their drinks and smoking their pipes about the Monastery: (12)
As of 2015-07-03 07:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (48 votes), past polls