
vinic0com
Novice
Feb 17, 2007, 1:05 AM
Post #13 of 16
(1154 views)
|
|
Re: [PGScooter] Special Data Extraction
[In reply to]
|
Can't Post
|
|
It appears that you understood me scooter. These records are being collected in 10 minute intervals, so I figure if I just pull the data from the last entry (bottom line) every 10 minutes I'll be good to go. Your code is giving me some problems though. Here's how I set it up
open (IN, 'tempLog.txt'); do { $lastline=$_; } while (<IN>) { chomp; $month = substr $_, 0, 3; $day = substr $_, 4, 2; $time = substr $_, 7, 8; $sensor = substr $_, 23, 1; $temp = substr $_, 37, 5; print "$month $day $time $sensor $temp\n"; } close (IN); but get this
C:\DIGI\WIN>perl extract.pl syntax error at extract.pl line 4, near ") {" syntax error at extract.pl line 18, near "}" Execution of extract.pl aborted due to compilation errors. I tried this
open (IN, 'tempLog.txt'); do { $lastline=$_ } ; while (<IN>) { but it reacted like the code does without the extra script.... just returns (prints) all lines of the data.
|