![]() |
|
|
|
|
|||||||
| 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 |
| How to strip non numerical data out of file? | Juha | Shell Programming and Scripting | 10 | 01-09-2007 04:09 AM |
| Creating file contents using contents of another file | ReV | Shell Programming and Scripting | 21 | 02-24-2006 07:25 AM |
| How to strip the contants from a file | isingh786 | UNIX for Dummies Questions & Answers | 2 | 12-16-2005 04:11 PM |
| How to strip apostrophe from a file | aquimby | Shell Programming and Scripting | 8 | 06-23-2005 12:04 PM |
| trying to strip the first 4 char. of a file out via commandline | Optimus_P | UNIX for Dummies Questions & Answers | 2 | 06-12-2001 10:02 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#8
|
|||
|
|||
|
sed -e 's/^isa//g' -e 's/[89][469][279]$//g' td.txt
this takes out the isa from beginning and then the numbers (three numbers) from the end of the line.you may output this code to a new file once you satisfied with the result. |
| Forum Sponsor | ||
|
|
|
#9
|
|||
|
|||
|
Hi Rkl1,
Thanks for the reply!!! This command just shows all the contents of the file. There are multiple ISA in the file, so it is showing all of them. But, I just want to see the contents for 999 not for 862 or others. In other words, what I need is look for the occurences of the 997 in the file. Once I find any 997, look for ISA before the 997 and then look for ISA after the 997 and extract that pice of data. i.e. extract the data between two ISA's which has 997 and there can be multiple occurences of 997 in a file. Regards, Inder |
|
#10
|
||||
|
||||
|
using gawk:
Code:
gawk -v RS='ISA' '/997/ {print RS $0}' myFile.txt
|
|
#11
|
|||
|
|||
|
Thanks a lot sir!!
It works perfect. Let me do some more testing with adding some other data to the file and I will let you know the results. Thanks!!! Inder |
|
#12
|
|||
|
|||
|
Hi Vgersh99,
Sorry for the delayed response. It works perfectly. Thanks for all your help. Regards, Inder |
|||
| Google The UNIX and Linux Forums |
| Thread Tools | |
| Display Modes | |
|
|