I have a file (data.txt) which contains the data:
ELITE�85.0000�Q�4 Days�Lilleshall�Chris
IMP�75.0000�Q�Tues&Fri�Lilleshall�Sue
LEFT�0.0000���Left�
PRESC�24.0000�T�One Day�Wrekin�Arleen
REC�27.0000�Q�Tues�Wrekin�Tony
I use the "LOAD DATA" DDL statement:
LOAD DATA LOCAL INFILE "data.txt" INTO TABLE squad FIELDS TERMINATED BY
"�" LINES TERMINATED BY "\n";
But when I "select * from squad" MySQL returns:
mysql> select * from squad;
+----------+-------+------+----------+------------+---------+
| Squad_id | Fee | Per | Days | Location | Coach |
+----------+-------+------+----------+------------+---------+
|LITE | 85.00 | Q | 4 Days | Lilleshall | Chris
| | 75.00 | Q | Tues&Fri | Lilleshall | Sue
| | 0.00 | | | Left |
|PRESC | 24.00 | T | One Day | Wrekin | Arleen
| REC | 27.00 | Q | Tues | Wrekin | Tony |
+----------+-------+------+----------+------------+---------+
5 rows in set (0.00 sec)
Notice how the table (more specifically the data) is malformmed even
thought the data in the file is visibly correct. Is there anything I
can do to make sure that the data in the file is imported successfully.
Also I use the field delimiter � (ALT+147) because the data MAY contain
your more standard delimiter "," (comma).
Any ideas
NOTE:
The table was created using
CREATE TABLE squad (
Squad_id VARCHAR(255),
Fee DECIMAL(20,2),
Per VARCHAR(255),
Days VARCHAR(255),
Location VARCHAR(255),
Coach VARCHAR(255)
);
Both client and server ar on the same machine (running on WinXP)
Thanks lots
David Ayliffe
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php