Example 1 (Without text qualifier):
abc,123,%&%$ will be converted to "abc", "123" , "%&%$" in 3 columns/cells
Example 2 (With text qualifier):
abc,123,%&%$ will be converted to "abc,123,%&%$" in one column/cell
In MySQL, the following code can be used to import CSV type of files into tables. The (FIELDS TERMINATED BY ',') is equivalent to Excel's delimiter while (ENCLOSED BY '"') is equivalent to Excel's text qualifier.
Code: Select all
LOAD DATA INFILE '/<PATH>/<new csv file>'
INTO TABLE Automobile.2016_Volvo_XC60_VOC
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\n';