Heres some extremely basic python for transforming a simple list of CRLF separated values into a sql statement.
def main():
fh = open('list.txt')
sql = open('sqlDump.txt','w')
i = 0
for line in fh:
statement = "INSERT INTO table (name) VALUES ('%s');\r" % line.rstrip()
sql.write( statement )
fh.close()
sql.close()
if __name__ == '__main__':
main()
Nothing special.
Off to china on sunday!!
再见
No comments:
Post a Comment