The idea is not bad, but if I understand correctly, you copied the "hundreds of CSV" into one file? This is a bad idea! You have to solve it in an outer iteral to go through the files and create tables with the same file name in a row. The number of columns in the CSV is determined by your program. You should build the cycle in such a way that you enter a path where the files are and go through them and create the table for each file and upload the data.