![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Replacing string in files | mohan705 | Shell Programming and Scripting | 2 | 08-28-2007 10:27 PM |
| Problem replacing the string | Viken | Shell Programming and Scripting | 2 | 03-18-2007 02:38 PM |
| replacing char with string | phani_sree | High Level Programming | 1 | 11-20-2006 04:57 AM |
| string replacing | priya_9patil | Shell Programming and Scripting | 1 | 11-03-2006 08:05 AM |
| replacing a string in a file with command line parameter | chiru_h | Shell Programming and Scripting | 5 | 08-03-2006 06:34 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
Replacing a string in nth line
Hello All,
How to replace a string in nth line of a file using sed or awk. For Ex: test.txt Line 1 : TEST1 TEST2 TEST3 Line 2 : TEST1 TEST2 TEST3 TEST4 Line 3 : TEST1 TEST2 TEST3 TEST5 Line 4 : TEST1 TEST2 TEST3 TEST6 Line 5 : TEST1 TEST2 TEST3 TEST7 i want to go to 4th line of a file and replace the word TEST2 in that line with the word DEV2. Note : this is not a homework. just need some ideas in SED or AWK Thanks Rahul |
| Forum Sponsor | ||
|
|