简体   繁体   中英

MySQL import csv file separated by tabulation

I need to import a CSV file into a table named "coplaints". The file is separated by tabulation. I already tried this:

load data local infile 'C:/Users/rocket/Documents/filipe ferminiano/processos/segmentacao/912013/coplaint.csv' 
into table crm_base.coplaints fields terminated by ' ' enclosed by '"';

But it doesn't work.

You need to use \\t as your field terminator for a tab separated file.

load data local infile 
'C:/Users/rocket/Documents/filipe ferminiano/processos/segmentacao/912013/coplaint.csv'
into table crm_base.coplaints fields terminated by '\t' enclosed by '"';

http://dev.mysql.com/doc/refman/5.1/en/load-data.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM