![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | 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 and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| UNIX newbie NEWBIE question! | Hanamachi | UNIX for Dummies Questions & Answers | 4 | 03-28-2009 04:10 PM |
| Simple newbie grep question | doubleminus | UNIX for Dummies Questions & Answers | 5 | 04-06-2008 07:05 PM |
| grep - searching for a specific string | manthasirisha | Shell Programming and Scripting | 2 | 01-05-2006 09:24 AM |
| searching searching | tony3101 | Shell Programming and Scripting | 3 | 06-04-2004 12:50 PM |
| searching for { | yotoruja | Shell Programming and Scripting | 4 | 11-03-2003 10:07 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
GREP Searching for a newbie...
Hi,
I really need some help with GREP searching... I need to find all occurances of a file reference and remove two characters from the end of the reference. For example, here are a few lines showing the text: <image file="STRAIGHT_004CR.jpg" ALT="STRAIGHT_004CR.jpg" /> <image file="STRAIGHT_006CR.jpg" ALT="STRAIGHT_006CR.jpg" /> <image file="STRAIGHT_007CR.jpg" ALT="STRAIGHT_007CR.jpg" /> And they then need to look like: <image file="STRAIGHT_004.jpg" ALT="STRAIGHT_004.jpg" /> <image file="STRAIGHT_006.jpg" ALT="STRAIGHT_006.jpg" /> <image file="STRAIGHT_007.jpg" ALT="STRAIGHT_007.jpg" /> I think I've written the correct search query which I think is: _\d{3}\D\D But I have no idea how to write the replacement string to remove the additional letters at the end of the string of 3 numbers and leave everything else in tact... ANy help would be much appreciated... Thanks Steve. |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|