I need to import a .txt file in which the fields are separated by commas, and if the field has a comma in it, that field is enclosed by quotes. However, when I import the file, it displays the quotes and kicks whatever is after the comma into the next field. I'd gladly enclose all fields with quotes, but the file is sent to me as a csv and I have to re-arrange the order of the fields. When I save the file Excel only puts quotes around the fields with commas.
So. Is there any magic way I can get the data to import correctly?
This is what I'm using now:
LOAD DATA LOCAL INFILE '/www/websitename/filetoimport071904.txt' INTO TABLE members FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\r'
Thanks.