in reply to Manipulating Text File in Perl
First off, use split(/,/, $_) to break up the line.
Then for converting lat and longitude formats:
my @latitude = split(/\./, $_[5]); my $latstring = sprintf("%8s", ($latitude[0] . $latitude[1])) ;
And finally for the state machine (totally untested):
while (<LOGFILE>) { chomp $_; if ($_[0] eq $lastline ) { if ($_[0] eq "1sec CDMA Event DtiC(0)") { #average those things or whatever you neeed to do }elsif ( $_[0] eq "Generic Scanner PN Measurement DtiC(0)") { #average those things or whatever you need to do } } else { #determine which part of the tuple this line is and #store Rxpower/add Rxpower and massage lat/long into strings } $lastline = $_[[0]; }
As I mentioned, all code is untested, but it's a starting point.
--
jpg
|
|---|