LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] sed advice required...

[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
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell