Posts

Showing posts from March, 2012

python csv to sql inserts

code below tells why i like python #!/usr/bin/env python import string def main():     file=open('yourfile.txt')     for i in file:         line=string.split(i,',')         print "insert into your_table values ('%s','%s','%s');" % (line[0],line[1],line[2]) if __name__ == '__main__':     main()