mirror of
https://github.com/matrix-construct/construct
synced 2024-08-21 09:04:44 +02:00
24 lines
434 B
Python
Executable file
24 lines
434 B
Python
Executable file
#!/usr/bin/python
|
|
|
|
import os
|
|
import sys
|
|
|
|
if len(sys.argv) < 2:
|
|
print "Usage: %s <sqlite3 dump file>" % sys.argv[0]
|
|
sys.exit(1)
|
|
|
|
file = sys.argv[1];
|
|
for line in open(file):
|
|
if not line.startswith("INSERT"):
|
|
continue
|
|
|
|
line = line.split(" ", 3)
|
|
line = line[3].rstrip(");\n")
|
|
line = line.lstrip("VALUES(")
|
|
line = line.split(",", 2)
|
|
line = line[2].split("',", 1)
|
|
line = line[1].strip("\\'")
|
|
sys.stdout.write(line)
|
|
|
|
sys.exit(0)
|