Extract text from file and insert into another file...

m0atz
09-05-2011, 07:59 AM
Hi, newb to the board, so apols if posted incorrectly.

I have code which writes a KML file with a line string, happy days. The file is saved as a timestamp of when it was created. Each output produces a new file, i.e. with each timestamp as the file name. I'm looking to have a master kml file which shows the placemark information from all the other files in the directory and add to it each time a new file is created.

I suppose being KML shouldnt really matter, all i'm looking to do is tell my code to go look for the file i've just created, open it, copy all text within the placemark /placemark tags and copy it to the master file.

Is this easy done? Any help appreciated.

webbone
09-05-2011, 01:08 PM
Since you are already writing the data out to each file, why not open the Master file at the same time (Open for APPEND) and write the data both places?

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum