LOAD DATA INFILE "data.txt" INTO TABLE table_name FIELDS TERMINATED BY
'|' ENCLOSED BY '"' LINES TERMINATED BY '\n';

You can find more on this at:

http://www.mysql.com/doc/en/LOAD_DATA.html


-----Original Message-----
From: Rudolf Bekker [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 15, 2003 2:43 AM
To: [EMAIL PROTECTED]
Subject: FW: Pulling large Microsoft SQL files into MySQL
Importance: High

 
-----Original Message-----
From: Rudolf Bekker 
Sent: Monday, 14 July 2003 14:13
To: MySQL MailList ([EMAIL PROTECTED])
Subject: Pulling large Microsoft SQL files into MySQL
Importance: High


The MySQL manual mentions that one could specify the column and value
separators and the end of file marker explicitly in the LOAD DATA
statement.
 
I'm looking for the syntax of this statement to import large data files
(.txt) originally exported from Microsoft SQL 7.
 
 
Example file:.
 
"Extract_Date"|"LAU"|"Customer_Number"|"BAN_Number"|"Telephone_Number"|"
Bill_Date"|"Local_Usage_Credit_Amount"|"Local_Usage_Credit_Call_Count"|"
Local_Usage_Credit_Call_Seconds"|"National_Usage_Credit_Amount"|"Nationa
l_Usage_Credit_Call_Count"|"National_Usage_Credit_Call_Seconds"|"Interna
tional_Usage_Credit_Amount"|"International_Usage_Credit_Call_Count"|"Int
ernational_Usage_Credit_Call_Seconds"|"Cell_Usage_Credit_Amount"|"Cell_U
sage_Credit_Call_Count"|"Cell_Usage_Credit_Call_Seconds"|"Other_Usage_Cr
edit_Amount"|"Other_Usage_Credit_Call_Count"|"Other_Usage_Credit_Call_Se
conds"
"20030409"|"63"|"63000233"|"630002330001"|"--"|"200211"|"0"|"0"|"0"|"0"|
"0"|"0"|"0"|"0"|"0"|"0"|"0"|"0"|"-555.94"|"0"|"0"
"20030409"|"63"|"63000233"|"630002330001"|"--"|"200302"|"0"|"0"|"0"|"0"|
"0"|"0"|"0"|"0"|"0"|"0"|"0"|"0"|"-594.24"|"0"|"0"
"20030409"|"63"|"63000233"|"630002330001"|"--"|"200303"|"0"|"0"|"0"|"0"|
"0"|"0"|"0"|"0"|"0"|"0"|"0"|"0"|"-615.21"|"0"|"0"
"20030409"|"63"|"63000235"|"630002350001"|"0539480616"|"200201"|"-10.53"
|"-14"|"-2346"|"-4.89"|"-6"|"-534"|"-1.3"|"-1"|"-26"|"-14.82"|"-4"|"-570
"|"0"|"0"|"0"
"20030409"|"63"|"63000283"|"630002830001"|"0539480627"|"200111"|"-6.14"|
"-1"|"-7804"|"0"|"0"|"0"|"0"|"0"|"0"|"0"|"0"|"0"|"0"|"0"|"0"
"20030409"|"63"|"63000283"|"630002830001"|"0539480627"|"200201"|"-140.79
"|"-143"|"-101519"|"-68.16"|"-43"|"-9723"|"0"|"0"|"0"|"-5.68"|"-4"|"-240
"|"0"|"0"|"0"
"20030409"|"63"|"63000421"|"630004210001"|"05393621802"|"200303"|"0"|"0"
|"0"|"-128.27"|"-22"|"-4680"|"0"|"0"|"0"|"-39.65"|"-6"|"-840"|"0"|"0"|"0
"
"20030409"|"63"|"63000459"|"630004590001"|"0539481533"|"200302"|"0"|"0"|
"0"|"0"|"0"|"0"|"0"|"0"|"0"|"-.01"|"0"|"0"|"0"|"0"|"0"
"20030409"|"63"|"63000495"|"630004950001"|"0539490419"|"200302"|"0"|"0"|
"0"|"0"|"0"|"0"|"0"|"0"|"0"|"-.02"|"0"|"0"|"0"|"0"|"0"
"20030409"|"63"|"63000519"|"630005190001"|"0539490719"|"200302"|"0"|"0"|
"0"|"0"|"0"|"0"|"0"|"0"|"0"|"-.01"|"0"|"0"|"0"|"0"|"0"
"20030409"|"63"|"63000521"|"630005210001"|"0539823312"|"200111"|"0"|"0"|
"0"|"-12.29"|"-5"|"-2100"|"-13.5"|"-1"|"-180"|"-264.15"|"-63"|"-17340"|"
-34.15"|"-19"|"-6360"
 
I need to specify the text separator as " " and the column separator as
|.
 
 
 
Thanx,
 
Rudolf.
 



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to