Dec-26-2019, 06:00 PM
Good morning all,
Having a good knowledge of databases and SQL, I would like to be able to automate the task of recovering data from a CSV file with python.
The idea would be to have a csv file containing a variable number of columns and lines of the type:
NAME, FIRST NAME, BIRTH; CITY; AGE
CASTEL; JULIETTE; 10/12/2000; LYON; 15
COHEN; PABLO; 16/05/1980; LYON; 78
AL BELA; ABDEL; 02/09/2001; LA CIOTAT; 23
CHAPELON; FRED; 03/10/2012; PARIS; 56
... and create an output .txt file containing this script:
Thank you and happy holidays.
Having a good knowledge of databases and SQL, I would like to be able to automate the task of recovering data from a CSV file with python.
The idea would be to have a csv file containing a variable number of columns and lines of the type:
NAME, FIRST NAME, BIRTH; CITY; AGE
CASTEL; JULIETTE; 10/12/2000; LYON; 15
COHEN; PABLO; 16/05/1980; LYON; 78
AL BELA; ABDEL; 02/09/2001; LA CIOTAT; 23
CHAPELON; FRED; 03/10/2012; PARIS; 56
... and create an output .txt file containing this script:
insert into NOM_DE_LA_TABLE (name, first name, birth, city, age) values ('CASTEL', 'JULIETTE', '10 / 12/2000 ',' LYON ', 15), ('COHEN', 'PABLO', '16 / 05/1980 ',' LYON ', 78), etc ...Unfortunately, I'm not sure how to do it.
Thank you and happy holidays.