[ILUG] sed advice required...

Richard Eibrand richard at eibrand.net
Thu Jul 1 21:36:03 IST 2004


Hi there,

I'm messing around with a wee script, and Im using sed to try and remove a  
series of numbers from a string. The problem is that the series of numbers  
is not always the same lenght.

i.e. text_I_want_to_remove=1234=part of string I want
and text_I_want_to_remove=12345=part of string I want

Im not all that good with sed, so what I have at the moment is

sed -e 's/text_I_want_to_remove=[0-9][0-9][0-9][0-9]=//' file with text  
strings>
which works for the string with 4 numbers, problem arises when there are 5  
or 6 numbers...

Is there perhaps a regexp that I could stick in instead of all the [0-9]'s?

Any tips would be appreciated.

R


-- 
Richard Eibrand
http://eibrand.net
richard at eibrand.net



More information about the ILUG mailing list