I have attached that file. The sample of data are as below:
PUBLT 167_89 656 PB -38321.478 6807.984 657 PB DAUD 200005041 278.271074.5150 69.4035 08370074.1830 69.2755 083800254.1925290.4620083900254.5615291.010008400008390098.2710 74.3630 20.3943 278.27100.0211 15.5954 74.3726 278.2748
PUBLT 167_89 656 PB -38321.478 6807.984 657 PB DAUD 200005042 278.271074.4940 68.1425 08430074.1610 68.0010 084400254.1720292.1650084500254.5400292.315508460008450098.2710 74.3418 22.0833 278.27100.0201 15.5958 74.3511 278.2746
what i gonna want to do is to extract those red data and then some simple calculation will be added because there are 2 lines for the same line number such as data for 656-657. The calculation are to get the average from the two values. The sample output are as below:
-this is data extracted for each line
656-657 278.2748
656-657 278.2746
-the final output i want is the average of those two line
656-657 278-27-47
For the calculation, the formula is as below:
278.2748 and 278.2746 are the value for bearing/ azimuth. It means 278 degree 27 minutes 48 seconds. So to get the average value of those two, we must consider the degree, minutes and seconds.
1. convert degree minutes seconds to decimal degrees
278+(27/60)+(48/3600) >>>> result is 278.4633333
278+(27/60)+(46/3600) >>>> result is 278.4627778
2. Convert to radian
278.4633333 x 180 / PI >>>>result is 4.860102013
278.4627778 x 180 / PI >>>>result is 4.860092316
3. get average
(4.860102013 + 4.860092316) / 2 >>>result is 4.860097165
4. Convert back average radian to degrees
4.860097165 x PI / 180 >>>>>>> result is 278.4630556
4. convert back degrees to degree minutes seconds
(for this formula i will create myself...)
the main problem here is i want to use 2 value from 2 line in one time to do that calculation... if those data in one line its not a problem.. how can i possibly do that?