Python Automation

Hello People,

I am trying to create tkinter gui where I would like to drag and drop CSV file and automatically CSV columns should match with SQL table columns…

As I am new in python I am not sure how to proceed further…

I would be happy if you guys could provide little bit hint or way to move ahead.

Thanks in advance :+1:

1 Like

Where are you stuck?

I’d start by skipping the drag-and-drop part right now and focus on your CSV processing. You could add a file-open dialog, or better yet, provide the CSV file on the command line. Once the CSV processing is correct, you can tackle the drag-and-drop bits.

For the CSV columns to match your SQL columns, you first need to get the columns from the CSV file. That is the first line of the CSV file. That needs to be parsed to get the column names. You might try to think about what how to respond if there are no column names in the file!

What is the definition of the “SQL columns” part? Are you trying to generate a SQL table definition from the CSV file? Are you working with an existing SQL database? You’ll need to be a little clearer with your definitions here.

1 Like