![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | 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 here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| string manipulation | james6 | UNIX for Dummies Questions & Answers | 5 | 06-03-2008 07:05 AM |
| String Manipulation Help | shadow0001 | Shell Programming and Scripting | 4 | 03-09-2008 01:35 PM |
| string manipulation | Cactus Jack | Shell Programming and Scripting | 9 | 02-14-2008 10:14 AM |
| string manipulation | hai1973 | Shell Programming and Scripting | 13 | 08-20-2007 08:27 AM |
| awk string manipulation | zoo591 | Shell Programming and Scripting | 2 | 08-09-2006 09:13 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
sed string manipulation
hi
I am using sed to split a string this string is 11byteabc I would like to just get the numeric digits. Code:
echo "11byteabc" | sed 's/*[a-z]// only solution that works is repeating [a-z] number of times for the letters which is pointless grateful for any suggestions thanks |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
The correct syntax for the regex is :
Code:
echo "11byteabc" | sed 's/[a-z]//g' Code:
echo "11byteabc" | sed 's/[^[:digit:]]//g' |
|
#3
|
|||
|
|||
|
thank you Jean-Pierre for the fast solution
|
|
#4
|
|||
|
|||
|
tr also works
echo "11byteabc" | tr -cd [:digit:]
|
|
#5
|
|||
|
|||
|
Hey everybody
I need some help on how to order the data in file such as a file have first name last name and city and i would like to order them to in the same order by using sed thanks alot for your time |
|||
| Google The UNIX and Linux Forums |