Open sant3e opened 2 years ago
Try and use this page to open your xlsx into pandas.
You should add in some print commands to check to see what the data looks like at each step.
I think the later functions that you're describing, are actually operating on the "cleaned" temp csv created by the program, so you shouldn't need to modify those.
I'm having the following issue: I have to dl some data from a SharePoint list; i can do it as a cvs file or an xlsx file. Unfortunately if i do it as a csv, some of the data gets corrupt, so i'm forced to do it as an xlsx. This option is not without issues as well (I had to add an extra function to clean some of the values within certain columns; which i've done successfully). The automation fails though at the last step (the upload to a db) with the following error:
I had to change all your csv statements into xlsx... up until the upload_to db function. There you have 2 statements:
dataframe.to_csv(file, header=dataframe_columns, index=False, encoding='utf-8') my_file = open(file)
and
sql_statement = """ COPY %s FROM STDIN WITH CSV HEADER DELIMITER AS ',' """
As I am aware one can't upload an xlsx to a db (at least not through python)(though i might be wrong); so i let those remain as csv. Right now, I'm not sure if those are the culprits or maybe my clean_text function has to address more issues then what i identified... point is, i'm stuck. I've been googling for 3 days, tried different solutions but none works. I would really need your help on this, and this was the only way i could contact you. Can you help me out?