Hi folks,
Using the ever-handy phpMyAdmin tool for MySQL db management, there's a CSV import option to parse lines like this (all GUI-like):
LOAD DATA INFILE 'file.csv'
INTO TABLE tbl_name
FIELDS TERMINATED BY ','
FIELDS ENCLOSED BY '\"',
FIELDS ESCAPED BY '\"'
LINES TERMINATED BY 'auto'
However, when I try that same sort of thing on the command-line, I can't get "terminated by auto" to work, with or without quotes. Looking at the MySQL documentation, this doesn't actually seem to be a legitimate instruction - maybe it's something slick that phpMyAdmin is doing in the background?
I want to be that slick too - does anyone know of a way to introduce that kind of flexibility at the code level? Have you already written a script that handles these variations? Any ideas?
Thanks
ken
|