Computing.Net > Forums > Unix > Search and replace

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Search and replace

Reply to Message Icon

Name: poornimajayan
Date: November 3, 2009 at 15:33:23 Pacific
OS: KSH
Product: Creative Vado pocket video cam pink camcorder
Subcategory: Software Problems
Comment:

In my file, I want to search all occurrences of '/>' and replace the same by a new line '\n' . How can I do this with sed?



Sponsored Link
Ads by Google

Response Number 1
Name: poornimajayan
Date: November 3, 2009 at 15:43:30 Pacific
Reply:

Slight correction. I need to add a new line '/n' to all ocurrences of '>' .I don't need replace.


0

Response Number 2
Name: poornimajayan
Date: November 4, 2009 at 06:03:42 Pacific
Reply:

I did with

nawk -v RS="<" 'length()==0{next}{print "<" $0}' test1.txt >>test11.txt


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More






Use following form to reply to current message:

Login or Register to Reply
LoginRegister


Sponsored links

Ads by Google


Results for: Search and replace

Unix - Search and replace www.computing.net/answers/unix/unix-search-and-replace/6775.html

Help search and replace www.computing.net/answers/unix/help-search-and-replace/6886.html

Search And Replace With Sed www.computing.net/answers/unix/search-and-replace-with-sed/3845.html