![]() |
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 |
| Perl: Search for string on line then search and replace text | Crypto | Shell Programming and Scripting | 4 | 01-04-2008 10:24 AM |
| Too simple to search for | spudtheimpaler | UNIX for Dummies Questions & Answers | 3 | 10-21-2006 12:55 PM |
| Search & replace | videsh77 | Shell Programming and Scripting | 1 | 01-14-2005 07:10 AM |
| Simple Search and Replace - Revisited | Brandt | Shell Programming and Scripting | 1 | 04-23-2004 10:45 AM |
| search and Replace | mukeshannamalai | UNIX for Advanced & Expert Users | 4 | 09-14-2001 06:21 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Simple? Search replace
in vi, if i type ctrl-J, i can shift the next line up to the current line.
I need to do this whenever a specific string exists (in particular ^M) ,however i have not been able to find a way to do this in vi, sed, or awk seems simple enough. can someone help me? thanks in advance |
|
||||
|
thanks, but it does not join all of the ^Ms
240|^M\ ^M\ ^M\ Old Port Marketing order recd $62,664.- to ship 6/22/99^M\ ^M\ ^M\ ^M\ ^MCompleted by: C. Malczynski| becomes: 240|^M\ ^M\ ^M\ Old Port Marketing order recd $62,664.- to ship 6/22/99^M\ ^M\ ^M\ ^M\ ^MCompleted by: C. Malczynski| but should be: 240|^M\ ^M\^M\ Old Port Marketing order recd $62,664.- to ship 6/22/99^M\^M\ ^M\^M\ ^MCompleted by: C. Malczynski| this is what i typed :g/^M\\/j ----- (ctrl-V, ctrl-M) any suggestions?? p.s. thanks, this has been stumping me for awhile Last edited by Brandt; 01-15-2004 at 04:50 PM.. |
|
||||
|
thanks, this has been really helpful, but i need to run this on several files that have >1000000 records, which i can break down into smaller files if need be (migrating data in case you haven't guessed), hence the reason i was trying to find a one time fell swoop, the solution you provided is much better than me scrolling for ^M and hitting Shft-J five or six times, but also doesn't lend itself to being run unattended, do you know of a way to peform the same task with sed?
if not, the help you have given me has been great, and i appreciate your quick responses. thanks again |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|