awohld has asked for the wisdom of the Perl Monks concerning the following question:
Event,1stEcIo,RxPower,Channel,Longitude,Latitude 1sec CDMA Event DtiC(0),-5.36,,,-88.150782,41.940351 Generic Scanner PN Measurement DtiC(0),,-83.35999999999997,384,-88.150 +782,41.940351 1sec CDMA Event DtiC(0),-6.36,,,-88.150782,41.940351 Generic Scanner PN Measurement DtiC(0),,-83.35999999999997,384,-88.150 +80400000001,41.940331 Generic Scanner PN Measurement DtiC(0),,-85.35999999999996,384,-88.150 +82600000001,41.940311 1sec CDMA Event DtiC(0),-7.36,,,-88.150848,41.940291 Generic Scanner PN Measurement DtiC(0),,-84.35999999999996,384,-88.150 +86533333333,41.94028566666667 Generic Scanner PN Measurement DtiC(0),,-88.36000000000001,384,-88.150 +88266666666,41.940280333333334
null,null,Ec,channel,long,lat 0,0,-75.2,384,-87606306,41798374
Then I need to add the RxPower from "Generic Scanner PN Measurement DtiC(0)" to the 1stEcIo from "1sec CDMA Event DtiC(0)" and then average those two coordinates.
Also the lat longs need the decimal places taken out and truncated to 8 digits long. I should end up with a log file like:
null,null,Ec,channel,long,lat
0,0,-70.5,384,-87777777,41111111
Where:
Ec = RxPower + 1stEcIo
Channel allways = 384
Lat & Long = the average lat/long for all datapoints combined to make row.
Here's some of my code that I started:
$LOGFILE = @ARGS; open(LOGFILE) or die("Could not open log file."); foreach $line (<LOGFILE>) { #This is where I'm lost, I don't know where to beging on chomping all +this data. }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Manipulating Text File in Perl
by Joost (Canon) on Apr 21, 2005 at 23:10 UTC | |
|
Re: Manipulating Text File in Perl
by sweetblood (Prior) on Apr 22, 2005 at 00:33 UTC | |
|
Re: Manipulating Text File in Perl
by jpeg (Chaplain) on Apr 22, 2005 at 00:22 UTC | |
|
Re: Manipulating Text File in Perl
by eibwen (Friar) on Apr 22, 2005 at 21:51 UTC |