How about something like this?
==================================================
# Path and name to report file.
$file = 'path/to/file';
# open the file for reading.
open (REPORT, "< $file");
# foreach line in the report.
while (<REPORT>) {
# if we see 'REPORT TITLE' that's the beginning of a page. Also turn
of the grabit flag for the beginning of the page.
if ($_ =~ 'REPORT TITLE') {
$pageBegin = 1;
$grabitFlag = 0;
# if we see the invoice turn on the grabit flag.
} elsif ($_ =~ 'Daily Invoicing Totals') {
$grabitFlag = 1;
# if non-of the above we're not the beginning of that page.
} else {
$pageBegin = 0;
}
# if the grabit flag is on and the pagebegin flag isn't push the
line onto an array.
if ($grabitFlag && !$pageBegin) {
push (@report, $_);
}
}
# print the array
foreach $line (@report) { print "$line\n" )
-----Original Message-----
From: Tony A Pinto [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 22, 2001 8: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
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
RE: Capturing just one page of several pages
Rogers, Gary (AP- Server Adminstrator) Wed, 22 Aug 2001 06:41:36 -0700
- Capturing just one page of several ... Tony A Pinto
- RE: Capturing just one page of... Rogers, Gary (AP- Server Adminstrator)
- RE: Capturing just one page of... Bob Showalter
- RE: Capturing just one pag... Tony A Pinto
