> -----Original Message-----
> From: Tony A Pinto [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, August 22, 2001 10:01 AM
> To: [EMAIL PROTECTED]
> Subject: Capturing just one page of several pages 
> 
> 
> Hi guys,
> I have a several page report  that runs to disk everyday of 
> which I need to
> capture information of  only one page.  There is no specific 
> page number to
> identify this page but there is a distinct report subheading 
> called "Daily
> Invoicing Totals" and this is the page in need to capture.  
> For example
> below
> it would be whole of page 2  that is of importance.
> FYI, the report runs of a UNIX server, so  if any of the 
> command line tools
> can do it that's fine too!  Any help is greatly 
> appreciated.... tia, Tony
> -----
> REPORT TITLE      PAGE -1
> .
> .
> ----page break
> .
> REPORT TITLE      PAGE -2
> .sub heading "Daily Invoicing Totals"
> .
> .
> -----page break
> REPORT TITLE      PAGE -3
> .
> -----page break
> REPORT TITLE      PAGE -4

This is a job for sed:

   sed -n '/Daily Invocing Totals/,/^REPORT TITLE/p' report.txt

Which perl can emulate using its range operator:

   perl -ne 'print if /Daily Invoicing Totals/,/^REPORT TITLE/' report.txt

The regexes simply match the first and last lines of the range you
want to print, so adjust them accordingly.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to