I have a text file that includes UUIDS that all look like this:
A4AB4CD2-016B-411E-8BA1-0000C592BF17
When I try and parse/print the file with python, most (but not all) end up looking like this:
12:40:54:457
There are three chunks per line that I'm parsing, a double, a date, and this uuid. The first two parts work fine. The relevant lines of code are:
for line in fileLines:
parts = line.split()
# Parse first two chunks
outputFile.write(""" WHERE tableID = '""" + uuid.UUID(parts[2]) + """'""")
This fails because the UUIDs are already of the form 12:40:54:547, but I don't know what this sub-type of UUID is called, let alone how to appropriately parse it. My goal is simply to read in the uuid exactly as it is, and re-print it with some extra text around it so I can run it as an SQL script.
I'm running python 3.3.2
A full line of input looks like this:
339.00 2013-06-18 12:40:54.457 A4AB4CD2-016B-411E-8BA1-0000C592BF17
parts[3].