Skip to content

Instantly share code, notes, and snippets.

View ian-otto's full-sized avatar

Ian Otto ian-otto

View GitHub Profile

Keybase proof

I hereby claim:

  • I am ian-otto on github.
  • I am duper51 (https://keybase.io/duper51) on keybase.
  • I have a public key ASAUP0nBDocX1chTCrOn3u8R_C-ehGP67kNNkvYaNvjFGQo

To claim this, I am signing this object:

@ian-otto
ian-otto / convert_single_insert_to_multiple.py
Created April 19, 2020 06:45
Hacky solution converts a single-insert-per-line MySQL dump, to a multiple insert per line MySQL dump.
import sys
with open(sys.argv[1], 'r') as inf:
with open('migrate_new/' + sys.argv[1], 'w') as outf:
line = inf.readline()
base = ""
started = False
counter = 0
while line:
if line.startswith("INSERT INTO"):