Parsing a string with text within it
I’m trying to read in and parse a CSV output file from PostgreSQL, but there are some oddities in the data. The data contains vehicle details. One problem is with old Land Rovers which have models measured in inches, e.g. 100″. PostgreSQL outputs this as “100′”” – it uses a single quote as the escape character.
REGXXXX,LAND ROVER,”100′””,1973-11-16,Diesel,2500,Silver
I’ve tried the csv.reader but this throws an error when it gets to “100′”” even if I specify encoding=”utf8″.
Python – parsing a string with text within it
I’m trying to read in and parse a CSV output file from PostgreSQL, but there are some oddities in the data. The data contains vehicle details. One problem is with old Land Rovers which have models measured in inches, e.g. 100″. PostgreSQL outputs this as “100′”” – it uses a single quote as the escape character.
REGXXXX,LAND ROVER,”100′””,1973-11-16,Diesel,2500,Silver
I’ve tried the csv.reader but this throws an error when it gets to “100′”” even if I specify encoding=”utf8″.