daily pastebin goal
58%
SHARE
TWEET

Untitled

a guest Mar 6th, 2012 22 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. input = open('svebaze.sql', 'r')
  2. current_file = None
  3. for line in input:
  4.     if line.startswith("USE '"):
  5.         if current_file:
  6.             current_file.close()
  7.         output_filename = "db_%s.sql" % (line.split("'")[1],)
  8.         current_file = open(output_filename, 'w')
  9.     else:
  10.         current_file.write(line)
  11. current_file.close()
RAW Paste Data
Pastebin PRO WINTER Special!
Get 40% OFF Pastebin PRO accounts!
Top