![]() |
Hello and Welcome from 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 |
| Shell script for text extraction from a file | vignesh53 | Shell Programming and Scripting | 3 | 02-05-2008 08:16 AM |
| Report file extraction based on Date range | ganapati | Shell Programming and Scripting | 2 | 07-13-2006 12:26 PM |
| date-extraction from a file in KSH | homer_hn | Shell Programming and Scripting | 6 | 04-21-2006 02:51 AM |
| need help appending lines/combining lines within a file... | mr_manny | Shell Programming and Scripting | 2 | 01-06-2006 06:45 PM |
| help on file extraction | apalex | UNIX for Dummies Questions & Answers | 1 | 05-01-2001 11:29 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Extraction of various lines from a hugh file
Dear Members,
I have a huge file generated by the command 'whois' for hundred of IPs. Each section in the file starts with [Querying whois I want to extract those lines which start with any of these words: [Querying whois, OrgName, NetRange, inetnum, descr, owner, Country in that section. Input: [Querying whois.XJHIOUIIOOPIOP] OrgName: University of C OrgID: U1 Address: OIT Address: NH City: BC StateProv: XY PostalCode: 000000 Country: MN NetRange: XXX.YYY.M.N - XXX.YYY.M.Q CIDR: LMANERIE NetName: UC [Querying whois.ABCE.TSD] % Rights restricted by copyright. % See % Note: This output has been filtered. % To receive output for a database update, use the "-B" flag inetnum: XXX.YYY.M.N - XXX.YYY.M.Q netname: NET-C descr: HB descr: The University country: PQ admin-c: TYE tech-c: SDF status: FGRG mnt-by: FSDGFG source: FGDFSG role: OPRROKROTR address: The University address: DJFIEJRE address: DIJAIRJEJ address: EIREROERE Required output: [Querying whois.BUHIOUJIOU] OrgName: HHHHHHHHHH (May or may not present) NetRange:TTTTTTTTT (May or may not present) inetnum: FTYFYYYUII (May or may not present) descr: HIJKJKLLKL (It will be better if only first occurrence) owner: JHKJOJOIPI (May or may not present) Country: OIOPOPOP (1st occurrence) Thanking you With regards |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|