M
MisterX
OK, I've tried googling, reading many perl books, but some things I
just dont get.
The problem: Parsing a simple backup.log. Below are the lines that I
need to extract. Note the leading space on the 1st line:
Server date/time: 01/03/05 20:05:57 Last access: 01/02/05
20:06:25
Total number of bytes transferred: 27.42 GB
Elapsed processing time: 01:04:07
The script thus far:
while (<LOGFILE>)
{
if ($_=~/Server date/ || /Total number of bytes/ || /Elapsed
processing time/ || /Elapsed processing time/)
{
($_=~ s/^\s+//);
print $_;
}
}
====================
Preferably I'd like it formatted (printf I suppose) nicely.
I know it's not pretty, what can i say I'm a noob. Any help is VERY
appreciated.
just dont get.
The problem: Parsing a simple backup.log. Below are the lines that I
need to extract. Note the leading space on the 1st line:
Server date/time: 01/03/05 20:05:57 Last access: 01/02/05
20:06:25
Total number of bytes transferred: 27.42 GB
Elapsed processing time: 01:04:07
The script thus far:
while (<LOGFILE>)
{
if ($_=~/Server date/ || /Total number of bytes/ || /Elapsed
processing time/ || /Elapsed processing time/)
{
($_=~ s/^\s+//);
print $_;
}
}
====================
Preferably I'd like it formatted (printf I suppose) nicely.
I know it's not pretty, what can i say I'm a noob. Any help is VERY
appreciated.