![]() |
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 |
| search for a string spread in multiple line | finder255 | Shell Programming and Scripting | 1 | 10-22-2008 04:25 PM |
| Multiple Line search using grep | pistachio | UNIX for Dummies Questions & Answers | 6 | 09-06-2008 11:11 AM |
| Perl: Match a line with multiple search patterns | Juha | Shell Programming and Scripting | 10 | 04-09-2008 01:43 AM |
| Multiple file processing - 1st line only to process - search/match substring | toneatlondon | Shell Programming and Scripting | 2 | 01-02-2008 09:20 PM |
| two lines into one colon separated line... | tonlu | Shell Programming and Scripting | 2 | 03-30-2005 10:27 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
multiple search separated by blank line
hi all
I want to get multiple search that are separated by blank line according to first search in text file eg: egrep 'x|Y|Z' file in that for each x...it should be seperated by blank line will u pls help |
|
||||
|
multiple search separated by blank line
I am not getting pls help
|
|
||||
|
multiple search separated by blank line
Pls examine this...
grep -B 1 ^$ | egrep 'Enter|@|SQL RUN' dat Enter value for authid: 560000 SQL RUN TIME--- 22-12-2008 13:57:29 @lienup.sql SELECTED VALUE Enter value for authid: 560000 SQL RUN TIME--- 22-12-2008 13:57:29 @lienup.sql SELECTED VALUE ........................................... before.....every first one (ie Enter valur for authid ..) i should get blank line thx in advance |
|
||||
|
cat list
DELETE:MD:TM,432350214576013; RESP:940120105; DELETE:MD:TM,432350415547447; RESP:940120105; SET:NOK:TM,432350110811018:T22,0; RESP:11000999; SET:MD:TM,4323500223734641; RESP:0; SET:NOK:TM,432350220813251:BAIC,1; RESP:0; SET:MD:TM,4323502142003351; RESP:0; DELETE:MD:TM,432350415283715; RESP:0; DELETE:MD:TM,432350415434001; RESP:0; SET:MD:TRIM,989370025055:LANG,English; RESP:0; DELETE:MD:TM,432350041977269:TRIM,989371036084;; RESP:940120105; SET:MD:TM,432350214483040; RESP:0; DELETE:MD:TM,432350021443483:TRIM,989362585071; RESP:0; grep -B 1 ^$ list | egrep 'DELETE|SET' DELETE:MD:TM,432350214576013; DELETE:MD:TM,432350415547447; SET:NOK:TM,432350110811018:T22,0; SET:MD:TM,4323500223734641; SET:MD:TM,4323502142003351; DELETE:MD:TM,432350415283715; DELETE:MD:TM,432350415434001; DELETE:MD:TM,432350041977269:TRIM,989371036084;; SET:MD:TM,432350214483040; DELETE:MD:TM,432350021443483:TRIM,989362585071; |
|
||||
|
cat file
Enter value for authid: 560000 SQL RUN TIME--- 22-12-2008 13:57:29 @lienup.sql SELECTED VALUE Enter value for authid: 560000 SQL RUN TIME--- 22-12-2008 13:57:29 @lienup.sql SELECTED VALUE Enter value for authid: 560001 SQL RUN TIME--- 22-12-2008 13:57:30 @lienup.sql SELECTED VALUE Enter value for authid: 560001 SQL RUN TIME--- 22-12-2008 13:57:30 @lienup.sql SELECTED VALUE Enter value for authid: 560002 SQL RUN TIME--- 22-12-2008 13:57:40 @lienup.sql SELECTED VALUE Enter value for authid: 560002 SQL RUN TIME--- 22-12-2008 13:57:40 @lienup.sql SELECTED VALUE Enter value for authid: 560003 SQL RUN TIME--- 22-12-2008 13:57:50 @lienup.sql SELECTED VALUE Enter value for authid: 560003 SQL RUN TIME--- 22-12-2008 13:57:50 @lienup.sql SELECTED VALUE grep -A 3 ^$ file | egrep 'Enter|SQL RUN|@' Enter value for authid: 560000 SQL RUN TIME--- 22-12-2008 13:57:29 @lienup.sql SELECTED VALUE Enter value for authid: 560001 SQL RUN TIME--- 22-12-2008 13:57:30 @lienup.sql SELECTED VALUE Enter value for authid: 560002 SQL RUN TIME--- 22-12-2008 13:57:40 @lienup.sql SELECTED VALUE Enter value for authid: 560003 SQL RUN TIME--- 22-12-2008 13:57:50 @lienup.sql SELECTED VALUE or try this grep -A 10 ^$ file | egrep -m 3 'Enter|SQL RUN|@' Last edited by reddyrajal; 12-23-2008 at 02:58 AM.. |
![]() |
| Bookmarks |
| Tags |
| awk, awk trim, trim, trim awk |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|