![]() |
|
|
|
|
|||||||
| 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 |
| Search and replace | jobbyjoseph | Shell Programming and Scripting | 12 | 02-06-2008 10:33 PM |
| Perl: Search for string on line then search and replace text | Crypto | Shell Programming and Scripting | 4 | 01-04-2008 06:24 AM |
| SED Search and Replace Question for Google Analytics | Neo | Shell Programming and Scripting | 11 | 08-07-2007 03:32 PM |
| search and replace | tungaw2004 | Shell Programming and Scripting | 1 | 03-23-2007 07:59 PM |
| sed search and replace | d__browne | UNIX for Dummies Questions & Answers | 7 | 04-26-2006 06:46 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
search and replace one more question
Hi,
I have a file that contains the following contents: 14:05 apple orange123 456mango 16:45 banana I wanted to replace ONLY the "14:05 " and "16:45" with nothing and trying to use the following syntax sed -e 's/[0-9][0-9]*//g' -e 's/^: //g' my_file > new_temp cat new_temp apple orange mango banana I only wanted to replace the "14:05 " and "16:45" and do not want to change the name of orange123 and 456mango while the above command has changed the file name as well. Can someone correct my syntax. I apprecaite you help in advance Regards, Ghazi |
| Forum Sponsor | ||
|
|