![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Split a file based on pattern in awk, grep, sed or perl | kumarn | Shell Programming and Scripting | 5 | 06-20-2008 10:51 AM |
| selecting only few lines from many based on a common pattern | damansingh | Shell Programming and Scripting | 2 | 05-28-2008 06:29 AM |
| replace character in a string pattern and save the change in same file | mihir0011 | Shell Programming and Scripting | 2 | 09-26-2007 05:31 PM |
| search file, change existing value based on input (awk help) | nortonloaf | Shell Programming and Scripting | 3 | 12-06-2006 01:35 AM |
| appending with sed based on matched pattern | jack1981 | Shell Programming and Scripting | 2 | 07-20-2006 06:54 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
how to change a particular value in a line of a file based on a pattern
eg: source file will be like ================= 99999999999 maximum number(0) ksuisikjjsl;;l skjss''llsl minimum number 0000000 maximum number of golds(0) target should be like ================= 99999999999 maximum number(1) ksuisikjjsl;;l skjss''llsl minimum number 0000000 maximum number of golds(1) the pattern i searched ihere is maximum, once i find the pattern the value which is (1) needs to change to (2). i will give command line parameters for the pattern needs to be searched and the existing value and the value which it needs to be changed. in the above example Pattern to search is maximum existing value is 1 value to be replaced is 2. Note : the open and closed braces will be there in all the lines < (1) >. |
|
||||
|
clarifications
The requirement needs to be done in run time.
Note : I have a previous task after the completion of the task the script needs to be kicked off and the changes needs to be made in the file. and also the reqt is < changing a particular value in a line of a file based on a pattern > |
|
||||
|
i would like to quickly clarify the reqt once again
eg: source file will be like ================= 99999999999 maximum number(0) ksuisikjjsl;;l skjss''llsl(0) minimum number 0000000(0) maximum number of golds(0) target should be like ================= 99999999999 maximum number(1) ksuisikjjsl;;l skjss''llsl(0) minimum number 0000000(0) maximum number of golds(1) |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|