|
Re: How to extract Numbers: msg#00067editors.sed.user
Surya Kiran Gullapalli wrote: > Hi all, > I've a string like this > > AAAxx.yy > where AAA are letters and xx and yy are numbers. I want to extract xx.yy > from the string. I'm doing some thing like this. > > echo abc12.34 | sed -e 's|^\D*\(\d.*\)|\1|g' > > but the result i'm getting is abc12.34 only. Where am i doing wrong ? I don't know what \D and \d are (I can guess). Here's how I would do it with BSD's sed. echo abc12.34 | sed -e 's/[^0-9.]*\([0-9]*\)/\1/g' -- +--- Steve Ahrendt ---+ | Industrial Control Systems Service and Design | +--- http://repairguy.net ---+ ------------------------ Yahoo! Groups Sponsor --------------------~--> Fair play? Video games influencing politics. Click and talk back! http://us.click.yahoo.com/2jUsvC/tzNLAA/TtwFAA/dkFolB/TM --------------------------------------------------------------------~-> -- Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/sed-users/ <*> To unsubscribe from this group, send an email to: sed-users-unsubscribe@xxxxxxxxxxxxxxx <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/ |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | How to extract Numbers: 00067, Surya Kiran Gullapalli |
|---|---|
| Next by Date: | RE: How to extract Numbers: 00067, Peter Hinxman |
| Previous by Thread: | How to extract Numbersi: 00067, Surya Kiran Gullapalli |
| Next by Thread: | RE: How to extract Numbers: 00067, Peter Hinxman |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |