Re: How can I search only a portion of a file?

From: Ignacio Vidal (ividal@BIYCSA.COM.AR)
Date: Wed Jul 17 2002 - 15:11:08 EDT


Maybe using awk with an internal variable that counts the occurence of
"A" until occurence of "> uniquestringABC" ?

Regards
Ignacio

> -----Mensaje original-----
> De: Taylor, David [mailto:DTaylor@WBMI.COM]
> Enviado el: miércoles, 17 de julio de 2002 15:03
> Para: aix-l@Princeton.EDU
> Asunto: How can I search only a portion of a file?
>
>
> Hi *
>
> Let's say that I have a file with the following contents:
>
> --------------------------------------
> A
> A
> B
> A
> uniquestringABC
> A
> B
> B
> A
> -------------------------------------
>
> How can I count the number of instances of 'A' up to the
> occurrence of
> uniquestringABC? How about the instances ~after~ uniquestringABC?
>
> There has to be an easier way than splitting the file at
> uniquestringABC and
> counting the separate files.
>
> TIA
>
> David
>
> David Taylor
> Senior Software Systems Engineer
> West Bend Mutual Insurance
> (262) 335-7077
> dtaylor@wbmi.com
>
>
>
> **********************************************************************
> This email and any files transmitted with it are confidential and
> intended solely for the use of the individual or entity to whom they
> are addressed. If you have received this email in error please notify
> the system manager.
>
> This footnote also confirms that this email message has been swept by
> MIMEsweeper for the presence of computer viruses.
>
> www.mimesweeper.com
> **********************************************************************
>



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 22:16:04 EDT