![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
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 |
| Extracting a Number from Passage | laknar | Shell Programming and Scripting | 1 | 05-07-2008 07:15 PM |
| extracting a string | start_shell | Shell Programming and Scripting | 2 | 09-30-2007 09:41 AM |
| Extracting a string from one file and searching the same string in other files | mohancrr | Shell Programming and Scripting | 1 | 09-19-2007 04:17 AM |
| Extracting 10 digit number from txt files | c19h28O2 | Shell Programming and Scripting | 9 | 08-07-2006 07:06 PM |
| extracting from a string | preetikate | Shell Programming and Scripting | 1 | 03-11-2004 08:08 AM |
|
|
LinkBack | Thread Tools | Search this Thread |
Rating:
|
Display Modes |
|
||||
|
extracting a number from a string
Hi everyone,
I have a string as follow ts1n65ulpa4096x16m16_130a_ss1p08v125c i would like to extract 4096 and 16 from string and save it into two variable. but this string could also have the form ts1n65ulpa32x16m16_130a_ss1p08v125c therefore the number before "x" could be 2 or 3 digits. i use the following but this code is not able to extract more than one digit before "x" echo "ts1n65ulpa4096x16_130a_ss1p08v125c" | sed -e 's/^[a-z0-9]*\([0-9][0-9]*x[0-9]*\).*/\1/' the output is 6x16 which is missing 409 as the number before "x" could anyone help me with this |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|