![]() |
|
|
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 |
| Grab a smaller and larger value | Raynon | Shell Programming and Scripting | 3 | 10-11-2007 07:23 AM |
| grab the line using awk | cdfd123 | Shell Programming and Scripting | 1 | 10-10-2007 09:21 AM |
| search and grab data from a huge file | ting123 | UNIX for Dummies Questions & Answers | 1 | 06-06-2006 10:41 PM |
| How to concatenate two strings or several strings into one string in B-shell? | fontana | Shell Programming and Scripting | 2 | 08-26-2005 12:58 PM |
| How to Grab the latest file | n9ninchd | UNIX for Dummies Questions & Answers | 1 | 05-10-2001 05:31 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
How to grab data between 2 strings ?
Hi All,
I have a text file below. How do i grab all the data between "05T00NPQSMR1" and "****" using awk ? Pls note that the text lines may not be fixed and text content is dynamic. Pls help. Thanks Below is my code where $LOT_SUFFIX is my shell variable. awk '/'"$LOT_SUFFIX"'/,/blah/' $nfile_selected Data Given: blah xxx yyy ********************************************************** ** 05T00NPQSMR1 P98P2234 Tue 10 03 09:57:24 2006 ** dibid= 1166 testerid= 6 ** sample= 100 0 ** tasM= MFMM xx xx xx ** tasC= MFMC xx xx xx ************************************ xxxx yyy zzz blah blah ********************************************************** ** 05T00NPQSMR1 P98P2234 Tue 10 03 09:57:24 2006 ** dibid= 1166 testerid= 6 ** sample= 100 0 ** tasM= MFMM xx xx xx ** tasC= MFMC xx xx xx ************************************ Expected Output: ********************************************************** ** 05T00NPQSMR1 P98P2234 Tue 10 03 09:57:24 2006 ** dibid= 1166 testerid= 6 ** sample= 100 0 ** tasM= MFMM xx xx xx ** tasC= MFMC xx xx xx ************************************ xxxx yyy zzz blah blah ************************************ |
| Bookmarks |
| Tags |
| regex, regular expressions |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|