There are two main approaches to this problem insofar as
I can see. The first is to strip out the bits of text that
you don't want leaving the bits that you do want. The second
approach is to ignore the bits you don't want and use a regex
to match the bits that you do want (the records). I would be
inclined to strip out the header using something along the
lines of:
#!/usr/bin/perl -w
use strict;
my ($REPFILE, $report);
undef $/; # Allows whole file to be slurped
open REPFILE, "sample.rep" or die "Can't open file $REPFILE: $!\n";
$report = <REPFILE>; # All file now in report variable
# Only do this for reasonably sized
# report files or buy some memory :)
$report =~ s/^User Report//g;
$report =~ s/^Other Header Stuff//g;
print $report;
Second approach, building a regex to strip out the data you
do want is left as an exercise for the reader.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.