I'm not a Python developer, but I'm using a Python script to convert SQLite to MySQL
The suggested script gets close, but no cigar, as they say.
The line giving me a problem is:
line = re.sub(r"([^'])'t'(.)", r"\1THIS_IS_TRUE\2", line)
...along with the equivalent line for false ('f'), of course.
The problem I'm seeing is that only the first occurrence of 't' in any given line is replaced.
So, input to the script,
INSERT INTO "cars" VALUES(56,'Bugatti Veyron','BUG 1',32,'t','t','2011-12-14 18:39:16.556916','2011-12-15 11:25:03.675058','81');
...gives...
INSERT INTO "cars" VALUES(56,'Bugatti Veyron','BUG 1',32,THIS_IS_TRUE,'t','2011-12-14 18:39:16.556916','2011-12-15 11:25:03.675058','81');
I mentioned I'm not a Python developer, but I have tried to fix this myself. According to the documentation, I understand that re.sub should replace all occurrences of 't'.
I'd appreciate a hint as to why I'm only seeing the first occurrence replaced, thanks.