waytoperl has asked for the wisdom of the Perl Monks concerning the following question:
I'm new to perl and want to write my first perl code, that will be used in a project. Problem: I've a file, "FileName.lib". Need to replace "values" with 500 for string_name500(Transition_11) and with 100 for string_name100(Transition_11). After replace, I need to save updated file with NewFileName.lib Please help me. these file consists -->
string_name500(Transition_11) { values ( \ "0, 0.0001, 0.0002, 0.0003, 0.0004, 0.0005, 0.0006, 0.0007, 0.0008 ",\ "0, 0.0001, 0.0002, 0.0003, 0.0004, 0.0005, 0.0006, 0.0007, 0.0008 ",\ "0, 0.0001, 0.0002, 0.0003, 0.0004, 0.0005, 0.0006, 0.0007, 0.0008 ",\ "0, 0.0001, 0.0002, 0.0003, 0.0004, 0.0005, 0.0006, 0.0007, 0.0008 ",\ "0, 0.0001, 0.0002, 0.0003, 0.0004, 0.0005, 0.0006, 0.0007, 0.0008 ",\ "0, 0.0001, 0.0002, 0.0003, 0.0004, 0.0005, 0.0006, 0.0007, 0.0008 ",\ "0, 0.0001, 0.0002, 0.0003, 0.0004, 0.0005, 0.0006, 0.0007, 0.0008 ",\ "0, 0.0001, 0.0002, 0.0003, 0.0004, 0.0005, 0.0006, 0.0007, 0.0008 "); + string_name100(Transition_11) { values ( \ "0, 0.0001, 0.0002, 0.0003, 0.0004, 0.0005, 0.0006, 0.0007, 0.0008 ",\ "0, 0.0001, 0.0002, 0.0003, 0.0004, 0.0005, 0.0006, 0.0007, 0.0008 ",\ "0, 0.0001, 0.0002, 0.0003, 0.0004, 0.0005, 0.0006, 0.0007, 0.0008 ",\ "0, 0.0001, 0.0002, 0.0003, 0.0004, 0.0005, 0.0006, 0.0007, 0.0008 ",\ "0, 0.0001, 0.0002, 0.0003, 0.0004, 0.0005, 0.0006, 0.0007, 0.0008 ",\ "0, 0.0001, 0.0002, 0.0003, 0.0004, 0.0005, 0.0006, 0.0007, 0.0008 ",\ "0, 0.0001, 0.0002, 0.0003, 0.0004, 0.0005, 0.0006, 0.0007, 0.0008 ",\ "0, 0.0001, 0.0002, 0.0003, 0.0004, 0.0005, 0.0006, 0.0007, 0.0008 ");
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Parse a file, replace a particular strings and save new file
by NetWallah (Canon) on Nov 13, 2013 at 05:16 UTC | |
|
Re: Parse a file, replace a particular strings and save new file
by davido (Cardinal) on Nov 13, 2013 at 08:09 UTC | |
|
Re: Parse a file, replace a particular strings and save new file
by ig (Vicar) on Nov 13, 2013 at 06:15 UTC | |
by sanku (Beadle) on Nov 13, 2013 at 09:36 UTC |