Also, Daniel Post what the data you're scanning looks like.  That should
help.


-Tom

-----Original Message-----
From: danield [mailto:[EMAIL PROTECTED]
Sent: Sunday, December 07, 2003 8:43 PM
To: [EMAIL PROTECTED]
Subject: Reading from a log - still a problem


Hello all,

I have received a solution for my problem (reading from log) from Tom
Kinzer. The code is:

#!/usr/bin/perl -w
use strict;
my $log_file = "/appl/log/00004e4d/20031130.txt";
open LOG, "< $log_file" or die "Could not open file $!";
while ( <LOG> ) {
  chomp;
  if ( /^GTotal Content:/ ) {
  my ($gtotal_content, $value) = split(/:/, $_);
  print $value;
  }
}
close LOG;

The problem is this code returns no value. When I remove all preceding
lines from the log (20031130.txt) and keep there only that GTotal
Content: 14,741,322, I will get desired result (14,741,322)

What may be a solution for this?

Thank you for your time.

danield




--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to