![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Extracting spec info from finger. | franny | UNIX for Dummies Questions & Answers | 6 | 12-12-2007 05:45 AM |
| Extracting specific info from finger command | franny | UNIX for Dummies Questions & Answers | 1 | 12-05-2007 10:13 AM |
| extracting XML file using sed | pujansrt | Shell Programming and Scripting | 7 | 06-29-2007 10:18 AM |
| extracting from tar.bz2 | Raom | UNIX for Advanced & Expert Users | 1 | 03-07-2006 07:33 AM |
| extracting info from Unix database to construct a visual diagram | fusion99 | UNIX for Advanced & Expert Users | 0 | 11-29-2004 10:29 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
Extracting Info
i have a file that contain lines like this
9.4.7.8.5.7.9.0.5.7.1.2.msisdn.sub.cs. 1 IN CNAME SDP01.cs. there are about 50,000 lines like this in the files i want to the extract the digits from the above line like:- 947857905712 OS Solaris9 |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
Code:
echo '9.4.7.8.5.7.9.0.5.7.1.2.msisdn.sub.cs. 1 IN CNAME SDP01.cs.' | sed 's/^\([0-9.][0-9.]*\).*/\1/;s/\.//g' |
|
#3
|
||||
|
||||
|
Try :
Code:
cut -c1,3,5,7,9,11,13,15,17,19,21,23 filename > newFile rishi |
|
#4
|
|||
|
|||
|
assuming input of the form that u had specified,
try this sed -e 's/[a-z].*//;s/\.//g' filename |
|||
| Google The UNIX and Linux Forums |
| Thread Tools | |
| Display Modes | |
|
|