Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^2: replace/substituion 4th field

by scsijon (Initiate)
on Feb 20, 2013 at 21:08 UTC ( #1019848=note: print w/replies, xml ) Need Help??


in reply to Re: replace/substituion 4th field
in thread replace/substituion 4th field

I'm new to this but I'd be doing something like

open file1 for input open file2 for output using >> so it appends .marker1. read a single line as variables $1, $2, ... use switch/case to select the field(s) you want to fix or alter change it(them) for that line of input (with case selecting fields you + want to alter in order) print to (output) file2 the variables $1,$2... check if endof input file if not goto the next line of the input file loop to .marker1. if eof input file add a print "\n"; to the output file (you usually need it) and close both input file and output file

simple I think, but i'm a newbie

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1019848]
help
Chatterbox?
[Corion]: A good morning to you too, marto!
[marto]: hey Corion, good weekend?
[prospect]: Thank you

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (8)
As of 2017-07-24 08:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I came, I saw, I ...
























    Results (348 votes). Check out past polls.