[CODE4LIB] mysql: terminated by AUTO -- myAdmin v commandline

2011-11-14 Thread Ken Irwin
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


Re: [CODE4LIB] mysql: terminated by AUTO -- myAdmin v commandline

2011-11-14 Thread Cary Gordon
You might want to try LINES TERMINATED BY '\r\n' or LINES TERMINATED
BY '\n'. I am not familiar with the auto option.

Thanks,

Cary

On Mon, Nov 14, 2011 at 8:19 AM, Ken Irwin kir...@wittenberg.edu wrote:
 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




-- 
Cary Gordon
The Cherry Hill Company
http://chillco.com