Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Parse a file, replace a particular strings and save new file

by NetWallah (Canon)
on Nov 13, 2013 at 05:16 UTC ( [id://1062326]=note: print w/replies, xml ) Need Help??


in reply to Parse a file, replace a particular strings and save new file

Welcome to the Monastery.

The following code solves your problem as specified.

If it does not do what you WANT, you need to improve your specification.

perl -pe '$x++ ? s/\bvalues\b/100 for string_name100(Transition_11)/ : s/\bvalues\b/500 for string_name500(Transition_11)/ ' FileName.lib > NewFileName.lib
Of course, it would help if you showed us what you TRIED, and explain what you have trouble with.

Please read How do I post a question effectively?.

             When in doubt, mumble; when in trouble, delegate; when in charge, ponder. -- James H. Boren

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2024-04-18 12:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found