![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | 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 !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| replace only 1st word of a line if it comes in the subsequent lines at same postion. | geeko | Shell Programming and Scripting | 8 | 07-03-2008 04:24 AM |
| Perl: Search for string on line then search and replace text | Crypto | Shell Programming and Scripting | 4 | 01-04-2008 06:24 AM |
| Search and replace multi-line text in files | marz | Shell Programming and Scripting | 10 | 10-10-2005 05:05 AM |
| Replace line of text in a file | colinchase | UNIX for Dummies Questions & Answers | 3 | 10-04-2001 06:54 AM |
| replace text in a file from the command line... | dudboy | UNIX for Dummies Questions & Answers | 1 | 09-04-2001 11:31 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
how to replace one line in text with several lines
Hi,
I need to replace a specific line in a text (eg the line contains the word MYSERVER) with a number of lines (let's say 4) in which the word MYSERVER will be replaced with server1 in the first line server2 in the second line server3 in the 3rd line server4 in the 4th line The original text would be something like lline1 line2 line3 THIS IS THE LINE WITH MYSERVER line4 line5 The resulting text should be like: lline1 line2 line3 THIS IS THE LINE WITH server1 THIS IS THE LINE WITH server2 THIS IS THE LINE WITH server3 THIS IS THE LINE WITH server4 line4 line5 If anyone could help with this it would be great! Thank you. |
| Forum Sponsor | ||
|
|