Last active
August 29, 2015 14:09
-
-
Save elliotwms/ccd5ad1619b08cb6b784 to your computer and use it in GitHub Desktop.
Parse a text file of websites into an SQL INSERT statement
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
f = open('output.sql', 'w'); | |
f.write('INSERT INTO websites (url) VALUES\n') | |
for line in open("websites.txt",'r'): | |
f.write('(\''+line.strip()+'\'),\n') | |
f.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment