Results 1 to 3 of 3
I am sitting here at my computer at 2:30am on a saturday morning with no idea what the hell im doing. But here's my goal I have a KML File ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 08-21-2010 #1
- Join Date
- Aug 2010
Help a guy learn some perl
I have a KML File for Google Earth. This file is generated with the GPS locations of certain sites.
I have a text file with extra information about certain sites. What i'm trying to figure out how to do is by using perl I want to open the text file grab the first location on line one and search for it in the KML file. When that line is found I want to edit the Description field in that KML file and add something to the description and change the placemark from Yellow to Blue.
Can anyone give me advice on the best way to handle this and where I can start. I can understand if nobody wants to give me the answer directly but I would like to be pointed in the right direction I would greatly appreciate it.
- 08-22-2010 #2
Do you know Perl already? I will assume that you know how to open a file and read the first location on its line.
Now then, I don't know what KML is, but as a general rule it is very difficult to modify a file in-place. It basically requires that your new values are the exact same length as whatever they're overwriting, and it's generally a bad idea. So what you're probably going to want to do is read the KML file into memory (parsing it as necessary), and then read your text file, get the location, and modify that in-memory KML file. Once you've done all of your modifications, you can print the file out.
Does this make sense?
- 08-22-2010 #3
- Join Date
- Apr 2010
- Novosibirsk, Russia