# Get user input for file name filename = raw_input("What filename for the kml.file") filename = filename + ".xml" # Open the files ## NOTE: This will overwrite any previous contents of Parsed.txt ## f = open("turns.txt", "r") r = open(filename, "w") # Get user input for folder name folder = raw_input("Into which folder do you want the pictures to go? ") firstline = True r.write(''+'\n') for line in f: split_line = line.split("\t") ## print split_line if split_line[3] != '': # Change 'pictures' to the specified folder name path = split_line[3] ## print path path = path[8:] path = folder + path # Change the '.jpg' ending to '.JPG' path = path[:-3] path += 'JPG' # Add the new line to the file new_line = '' else: new_line = '' ## print new_line if firstline: firstline = False # Don't want to add the first line else: r.write('\t' + new_line + '\n') r.write("") # Close the files r.close() f.close()