Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- input = open('svebaze.sql', 'r')
- current_file = None
- for line in input:
- if line.startswith("USE '"):
- if current_file:
- current_file.close()
- output_filename = "db_%s.sql" % (line.split("'")[1],)
- current_file = open(output_filename, 'w')
- else:
- current_file.write(line)
- current_file.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement