![]() |
|
|
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 |
| GREP and Retrieve Line by Line | maxmave | Shell Programming and Scripting | 2 | 06-03-2008 12:45 PM |
| How to grep only 1st line | St.Fartatric | UNIX for Dummies Questions & Answers | 3 | 05-19-2008 07:24 AM |
| how to exclude the GREP command from GREP | yamsin789 | UNIX for Advanced & Expert Users | 2 | 10-05-2007 03:59 AM |
| grep the line only if next line matches | pbsrinivas | Shell Programming and Scripting | 11 | 07-10-2007 09:51 AM |
| diffrent results between command line and scripted grep | r1500 | Shell Programming and Scripting | 1 | 11-24-2003 02:05 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Grep using line command
Hello
I have a pretty big problem here. I have a very large file having lines running into millions. A small sample of the data is shown below <CRMSUB:MSIN=5000000013,BSNBC=TELEPHON-55108663-TS11&TS21&TS22,MSCAT=ORDINSUB,SUBRES=ALLPLMN-AIRSIMLA,BAOC=OIC,NUMTYP=MULTI; <ENTRGCSERV:MSIN=5000000013,GCSERV=CALLWAIT-PROV&CALLHOLD&CLIP,CLIPOVR=NO; <ENTRCBSERV:MSIN=5000000013,CBSERV=CBOIC,BSVG=TELEPHON,CCB=OPR,PW=0000; <ENTRCFSERV:MSIN=5000000013,CFSERV=CFBUSY,NCS=NO,NFS=NO; <ENTRCFSERV:MSIN=5000000013,CFSERV=CFNREPLY,NCS=NO,NFS=NO; <ENTRCFSERV:MSIN=5000000013,CFSERV=CFNREACH,NCS=NO; <ENTRCFSERV:MSIN=5000000013,CFSERV=CFU,NCS=NO; <CRMSUB:MSIN=5000000017,BSNBC=TELEPHON-55103911-TS11&TS21&TS22,MSCAT=ORDINSUB,SUBRES=ALLPLMN-AIRSIMLA,BAOC=OIC,NUMTYP=MULTI; <ENTRGCSERV:MSIN=5000000017,GCSERV=CALLWAIT-ACT-TELEPHON&CALLHOLD&CLIP&NATSS05,CLIPOVR=NO; <ENTRCBSERV:MSIN=5000000017,CBSERV=CBOIC,BSVG=TELEPHON,CCB=OPR,PW=0000; <ENTRCFSERV:MSIN=5000000017,CFSERV=CFBUSY,NCS=NO,NFS=NO; <ENTRCFSERV:MSIN=5000000017,CFSERV=CFNREPLY,NCS=NO,NFS=NO; <ENTRCFSERV:MSIN=5000000017,CFSERV=CFNREACH,NCS=NO; <ENTRCFSERV:MSIN=5000000017,CFSERV=CFU,NCS=NO; <CRMSUB:MSIN=5000000019,BSNBC=TELEPHON-55169401-TS11&TS21&TS22,MSCAT=ORDINSUB,SUBRES=ALLPLMN-AIRSIMLA,BAOC=OIC,NUMTYP=MULTI; <ENTRCFSERV:MSIN=5000000019,CFSERV=CFBUSY,NCS=NO,NFS=NO; <ENTRCFSERV:MSIN=5000000019,CFSERV=CFNREPLY,NCS=NO,NFS=NO; <ENTRCFSERV:MSIN=5000000019,CFSERV=CFNREACH,NCS=NO; <ENTRCFSERV:MSIN=5000000019,CFSERV=CFU,NCS=NO; <ENTRGCSERV:MSIN=5000000019,GCSERV=CALLWAIT-PROV&CALLHOLD&CLIP,CLIPOVR=NO; As can be seen there is only common parameter ie the MSIN. Now i have to obtain data for close to a 1000 different MSINs. I cannot grep for those MSINs from my entire data. If the first occurence for a particular MSIN is say on line 4000 of 1000000 lines. If i know that the MSIN will occur from lines 4000 to 4020 and guaranteed that the MSIN will not occur after line 4020, then is there a way that my grep command will exit after line 4020 and start looking for the next MSIN? Will be very grateful if anyone can suggest a quick and easy solution for this. Thanks in advance Regards Pradeep |
![]() |
| Bookmarks |
| Tags |
| regex, regular expressions |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|