From the following;
- Code: Select all
-87 1.5319959 32 24.3091365 624.8 599999.5 0
-87 1.4278910 32 24.3534171 624.8 600600.4 0
-87 1.3237846 32 24.3976961 624.8 600599.8 0
-87 1.2196764 32 24.4419736 624.8 600599.8 0
-87 0.8032268 32 24.6190693 624.8 600.0 0
The first line should read;
-87.0255333,32.4051523,624.8
longitude = 87 + (1.5319959 / 60), latitude = 32 + (24.3091365 / 60)
I must keep the output values to 7 decimal places and rounding the 7th place.
here is the code I'm using. the calculation is taking place in the second loop (which is totally wrong). this is my first crack at javascript and I've tried several different ways but I just can't seem to get calculations to work.
- Code: Select all
UltraEdit.insertMode();
UltraEdit.columnModeOff();
UltraEdit.activeDocument.hexOff();
UltraEdit.ueReOn();
UltraEdit.activeDocument.findReplace.regExp = true;
UltraEdit.activeDocument.findReplace.replaceAll = false;
UltraEdit.activeDocument.bottom();
if (UltraEdit.activeDocument.isColNumGt(1)) UltraEdit.activeDocument.insertLine();
UltraEdit.activeDocument.top();
var runn = "%^(RUN [0-9]+^) +^(-[0-9]+ [0-9]+.[0-9]+ [0-9]+ [0-9]+.[0-9]+^) +^(-[0-9]+ [0-9]+.[0-9]+ [0-9]+ [0-9]+.[0-9]+^) ^([0-9]+^) [0-9]*$";
while ( (UltraEdit.activeDocument.findReplace.find(runn)) && ! UltraEdit.activeDocument.isEof() ) {
UltraEdit.activeDocument.findReplace.replace(runn,"^1" + " Total Points = " + "^4");
}
UltraEdit.activeDocument.top();
var coors = "% ^(-[0-9]+^) ^([0-9]+.[0-9]+^) ^([0-9]+^) ^([0-9]+.[0-9]+^) ^([0-9]*^) [0-9]*$";
while ( (UltraEdit.activeDocument.findReplace.find(coors)) && ! UltraEdit.activeDocument.isEof() ) {
UltraEdit.activeDocument.findReplace.replace(coors, ("^1" + ("^2" / 60)) + "," + "("^3" + ("^4" /60))" + "," + "^5");
}
UltraEdit.activeDocument.top();
thanks
Paul


