Skip to content

Commit 25a05f3

Browse files
committed
Added support for multiple CSV files. This commit modifies the CSVToSQLConverter class to support multiple CSV files. The main method has been updated to iterate over an array of CSV file paths and call the convertCSVToSQL method for each file. Each CSV file is converted into a separate SQL table, the name of which is derived from the name of the CSV file.
1 parent 816ae65 commit 25a05f3

6 files changed

Lines changed: 15 additions & 2773 deletions

File tree

liste_complete_entreprises_2023_2024.csv

Lines changed: 0 additions & 2772 deletions
Large diffs are not rendered by default.
992 Bytes
Binary file not shown.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Raison Sociale,Activité,Adresse 1,Adresse 2,Code Postal,Ville,Pays,Téléphone fixe,Téléphone portable,E-mail,Site Web,Civilité du responsable,Nom resp.,Prénom du responsable,Fonction du responsable,Téléphone fixe du responsable,Fax resp.,Téléphone portable du responsable,E-mail resp.,Créée le,Date de derniere modification
2+
01 PHOENIX INFORMATIQUE,Informatique,14 rue Marcel Paul,,1500,AMBERIEU EN BUGEY,,04 37 61 12 93,,,,Monsieur,BEARD,Nicolas,,04 37 61 12 93,,,phoenix@informatique-phoenix.com,27/08/2018,26/09/2022

src/main/java/com/mycompany/csvtosqlconverter/CSVToSQLConverter.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,19 @@
77

88
public class CSVToSQLConverter {
99
public static void main(String[] args) {
10-
String csvFile = "C:\\Users\\paulb\\Desktop\\travail\\CSVToSQLConverter\\liste_complete_entreprises_2023_2024.csv";
10+
// Liste des fichiers CSV
11+
String[] csvFiles = {
12+
"Votre chemin ",
13+
"Second chemin",
14+
// Add other CSV file paths here
15+
};
16+
17+
for (String csvFile : csvFiles) {
18+
convertCSVToSQL(csvFile);
19+
}
20+
}
21+
22+
public static void convertCSVToSQL(String csvFile) {
1123
String line = "";
1224
String cvsSplitBy = ",";
1325

127 Bytes
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)