So i'm trying to extract columns from a csv file, and input these into a mysql table.
However, I'm getting the following error which is targetting a 'title' (column 3,line1)
'Using Adversarial Autoencoders for Multi-Modal Automatic Playlist Continuation, ' at line 1")
csv data
1038819,Discoverable,Using Adversarial Autoencoders for Multi-Modal Automatic Playlist Continuation,Conference Proceeding,"Vagliano, Iacopo; Galke, Lukas; Mai, Florian; Scherp, Ansgar",10.1145/3267471.3267476,
1037162,Discoverable,Performance Comparison of Ad-hoc Retrieval Models over Full-text vs. Titles of Documents (Forthcoming),Conference Proceeding,"Saleh, Ahmed; Beck, Tilman; Galke, Lukas; Scherp, Ansgar",,1893/28014
I think it has something to do with the fact the author column is using ',', and there is a whole mix of different spacing and symbols in others.
Python
import pymysql
import csv
csv_data= csv.reader(open('Book1.csv'))
conn=pymysql.connect("localhost","root", "root", "test")
cursor=conn.cursor()
print ("Done")
for row in csv_data:
cursor.execute('INSERT INTO output (Output_ID, Status, Title, Type, Authors, DOI, Handle ) VALUES({}, {}, {}, {}, {}, {}, {})'.format(row[0], row[1], row[2], row[3], row[4], row[5], row[6]))
conn.commit()
cursor.close()