i have some big .csv files.
i want to load them to mySql with LOAD DATA INFILE
.
but the files have lines that the same.
how could i load the files to mySql without the same lines?
this is my source:
// Import csv data in table in respective rows.
$sql = "LOAD DATA LOCAL INFILE '$position' INTO TABLE temp
FIELDS TERMINATED BY ' '
LINES TERMINATED BY '\n'
IGNORE $i LINES
(CHROM, POS, ID, REF, ALT, QUAL, FILTER, INFO)";
// Execute query
if (mysqli_query($config,$sql)) {
echo "Table populated successfully.\n";
} else {
echo "Error populating table: " . mysqli_error($config) . ".\n";
}
in the mySql i have the columns: CHROM, POS, ID, REF, ALT, QUAL, FILTER, INFO.
i can know that it same lines if CHROM && POS equal in different lines.
i can have same lines JUST in different files.