Re: Pattern Match query

From: Kumar, Praveen (cahoot) (Praveen.Kumar@CAHOOT.COM)
Date: Tue Mar 16 2004 - 06:01:20 EST


Many thanks Simon .. i could do it..

Cheers
Praveen.K

-----Original Message-----
From: Green, Simon [mailto:Simon.Green@EU.ALTRIA.COM]
Sent: 16 March 2004 10:15
To: aix-l@Princeton.EDU
Subject: Re: Pattern Match query

I'm pretty sure you could do this with awk. If you're not familiar with it,
try searching the Internet for examples. I found this...
http://www.ecs.soton.ac.uk/docs/gnu/gawk/gawk_1.htm
...quite useful a little while ago.

Perl could do it, of course.

You could probably cobble something together using grep -n and tail -n +XX"
Say...
export IFS=':'
grep -n <pattern> <file>|read First Junk
tail -n +$First <file>

Perl or Awk would be more efficient, but if this is a one-off that might do.

--
Simon Green
Altria ITSC Europe Ltd
AIX-L Archive at https://new-lists.princeton.edu/listserv/aix-l.html
New to AIX? http://publib-b.boulder.ibm.com/redbooks.nsf/portals/UNIX
N.B. Unsolicited email from vendors will not be appreciated.
Please post all follow-ups to the list.
> -----Original Message-----
> From: Kumar, Praveen (cahoot) [mailto:Praveen.Kumar@CAHOOT.COM]
> Sent: 16 March 2004 09:42
> To: aix-l@Princeton.EDU
> Subject: Pattern Match query
>
>
> Hi *,
>         i have a large file where i want to search for a
> pattern and once
> the pattern is matched i want all the content of the file
> after the first
> occurence of the match till the EOF. i have tried this using
> nl etc but
> could not really make it up.It woudl be great if some one can
> give me some
> idea.
.sophos.3.79.03.16.
*********************
Internet communications are not necessarily secure and may be intercepted or
changed after they are sent.  cahoot does not accept liability for any such
changes.
If you wish to confirm the origin or content of this communication, please
contact the sender using an alternative means of communication.
This communication does not create or modify any contract.
This email may contain confidential information intended solely for use by
the addressee.  If you are not the intended recipient of this communication
you should destroy it without copying, disclosing or otherwise using its
contents.
Please notify the sender immediately of the error.
cahoot is a division of Abbey National plc.
Abbey National plc is registered in England, registered number 2294747.
Registered Office: Abbey National House, 2 Triton Square, Regent's Place,
London, NW1 3AN.


This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 22:17:42 EDT