Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

phpmyadmin: Import tab deliminated file

Tags:

csv

phpmyadmin

What settings do you need to choose for phpmyadmin to import a tab delimited file? There are no enclosures or end of line markers.

Something like:

Title 1 Title 2 Title 3
item1   item2   item3

I used to know how to do such a simple task, but have now worked with phpmyadmin for ages and can't even find my answer on google. Every search result gives the settings for normal CSV files.

like image 743
user2231688 Avatar asked May 28 '13 05:05

user2231688


1 Answers

LOAD DATA INFILE has a column-specification at the end.

LOAD DATA INFILE ... 
INTO TABLE ... 
FIELDS TERMINATED BY '\t'
IGNORE 1 LINES;

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 '"';
like image 72
Xman Classical Avatar answered Nov 06 '22 17:11

Xman Classical