can someone please write a very simple script/program for me
Posted: Thu Aug 25, 2005 10:50 pm
i need a script or basically just some very simple program that can go through a single text file and perform calculations on what it reads.
(if you'd like some background info - i need to slightly move every single one of my googleearth placemarks by the same amount, they are stored in a KML file which is a text format which reads similar to HTML. but you don't really need to know that.)
whenever it comes to a:
<longitude>153.0383065339457</longitude> <- (the number can be anything)
it needs to add 0.000236 to it.
something like a X = X + 0.000236 calculation.
likewise whenever it come to a:
<latitude>-27.3234919378792</latitude>
it needs to subtract 0.000099 from it, like Y = Y - 0.000099
also these same latitude and longitude coordinates are stored in a fashion of: <coordinates>153.0383780839505,-27.32346712044058,0</coordinates>
or multiple coordinates can be stored eg:
<coordinates>153.0381411994351,-27.32336782241054,0 153.0380886432859,-27.32356806599593,0 153.0377780926332,-27.32352752614733,0 153.0374658800643,-27.32529301530822,0 153.0374017293408,-27.32602554183629,0 153.0370678824056,-27.327709605444,0 153.0419233643279,-27.32855869540169,0 153.0413454586722,-27.33142339015328,0</coordinates>
it's basicly <coordinates> X,Y,0 X,Y,0 X,Y,0 X,Y,0</coordinates> with each set seperated by a space.
as with the first example it's the same:
all X figures needs have have 0.000236 added to it.
all Y figures needs to have 0.000099 subtracted from it.
the 0, space, and commas are left untouched.
i'm not knowledgeable enough atm in programming to be able to write a program/script that can do this. but it seems very simple to do, so can someone please help by writing something i can run that will do this?
perhaps it can be done with a script run in another program that i already have - i have the MS Office suite if that can help, and i likely have java installed. i don't know, i'm sure you'll know a good idea!
even if you don't write something, some advice would be helpful.
(i have done various forms of programming over the years, but i havn't done any for a while and as a result i am unfamilure with the syntax for the langauges i have and don't know howto work the compilers)
(if you'd like some background info - i need to slightly move every single one of my googleearth placemarks by the same amount, they are stored in a KML file which is a text format which reads similar to HTML. but you don't really need to know that.)
whenever it comes to a:
<longitude>153.0383065339457</longitude> <- (the number can be anything)
it needs to add 0.000236 to it.
something like a X = X + 0.000236 calculation.
likewise whenever it come to a:
<latitude>-27.3234919378792</latitude>
it needs to subtract 0.000099 from it, like Y = Y - 0.000099
also these same latitude and longitude coordinates are stored in a fashion of: <coordinates>153.0383780839505,-27.32346712044058,0</coordinates>
or multiple coordinates can be stored eg:
<coordinates>153.0381411994351,-27.32336782241054,0 153.0380886432859,-27.32356806599593,0 153.0377780926332,-27.32352752614733,0 153.0374658800643,-27.32529301530822,0 153.0374017293408,-27.32602554183629,0 153.0370678824056,-27.327709605444,0 153.0419233643279,-27.32855869540169,0 153.0413454586722,-27.33142339015328,0</coordinates>
it's basicly <coordinates> X,Y,0 X,Y,0 X,Y,0 X,Y,0</coordinates> with each set seperated by a space.
as with the first example it's the same:
all X figures needs have have 0.000236 added to it.
all Y figures needs to have 0.000099 subtracted from it.
the 0, space, and commas are left untouched.
i'm not knowledgeable enough atm in programming to be able to write a program/script that can do this. but it seems very simple to do, so can someone please help by writing something i can run that will do this?
perhaps it can be done with a script run in another program that i already have - i have the MS Office suite if that can help, and i likely have java installed. i don't know, i'm sure you'll know a good idea!
even if you don't write something, some advice would be helpful.
(i have done various forms of programming over the years, but i havn't done any for a while and as a result i am unfamilure with the syntax for the langauges i have and don't know howto work the compilers)