I'm converting a sqlite3 database to mysql.
I have a nice command file for sed that changes AUTOINCREMEMT and the other things needed, but I'm stuck on the last one: double quotes.
sqlite3 dump format:
CREATE TABLE "products" (
"id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
"name" varchar(255),
"desc" varchar(255) );
INSERT INTO "products" VALUES(1,'Flux Capacitor',
'This is the "real" thing.\nPromise!')
For the first statement, I can replace all double quotes with backticks and mysql will be happy.
However, my product information has double quotes in the data. How can I exclude these from being replaced? I was trying to replace only those double quotes with a placeholder, then I could replace all the other double quotes, then I could change the placeholder back, but my regex-fu isn't up to par.
This was as far as I got:
/"[^"]*"/s
... to match the double quoted texts, but I couldn't figure out how to qualify that only double quotes inside single quotes should be matched.