![]() |
|
|
|
|
|||||||
| 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 |
| Search, replace string in file1 with string from (lookup table) file2? | gstuart | Shell Programming and Scripting | 2 | 04-11-2008 11:32 AM |
| Perl: Search for string on line then search and replace text | Crypto | Shell Programming and Scripting | 4 | 01-04-2008 07:24 AM |
| Insert line break in vi's command mode | Skogsmulle | UNIX for Dummies Questions & Answers | 3 | 07-06-2007 07:47 AM |
| String Search & Replace | IwishIknewC | UNIX for Dummies Questions & Answers | 1 | 03-25-2006 03:28 AM |
| string search replace | krishna | UNIX for Advanced & Expert Users | 1 | 12-19-2001 10:49 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
how to insert line break + string in vi (search & replace )
Hello all
i have big test file that has allot of structure text something like this : <foo1 *.html> <blah action> somthing 1 somthing 2 </blah> </foo1 > now i will like to insert 2 more lines of text below the <blah action> so it will be like : <foo1 *.html> <blah action> param1 off param2 off somthing 1 somthing 2 </blah> </foo1 > i need to be able to insert it all across the text file . i know i can do search and replace in vi with %s/action\>$/.........../g but i don't know how to tell the replace command to insert line brakes ( i think this is what i need) |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
Code:
:%s/action\>$/&^M........../ |
|||
| Google The UNIX and Linux Forums |