This worked for me:
create table tblZips(
id int unsigned not null auto_increment primary key,
city char(24) not null default '',
state char(2) not null default '',
zip char(5) not null default ''
) Type=InnoDB;
Saved CSV file as a UNIX (instad of DOS format file)
LOAD DATA
INFILE 'zips.csv'
INTO TABLE tblZips
FIELDS TERMINATED BY ','
ENCLOSED BY '\''
LINES TERMINATED BY '\n'
(city,state,zip);
Query OK, 41943 rows affected (3.86 sec)
Records: 41943 Deleted: 0 Skipped: 0 Warnings: 0
mysql select min(id) AS first, max(id) AS last, count(id) as total FROM
tblZips;
+---+---+---+
| first | last | total |
+---+---+---+
| 20973 | 62915 | 41943 |
+---+---+---+
-
Johnny Withers
[EMAIL PROTECTED]
p. 601.853.0211
c. 601.209.4985
-Original Message-
From: Sean O'Donnell [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 20, 2002 5:00 PM
To: MySQLMailingList
Subject: LOAD DATA LOCAL INFILE (Only loads 20,000 or 41,000 Records)
his is my first post here so please excuse any irrelevancies.
I am trying to load a .csv file that contains 41943 Records of Data.
I am only able to load 20972 Records. (it seems to skip almost
every-other
record).
The file, located @:
http://thisLinux.kicks-Ass.net/projects/databases/tbl_mapZipCodes.csv
and contains 41943 lines that match the following comma-seperated
structure:
'Pleasantville','NY','00401'
'Holtsville','NY','00501'
'Holtsville','NY','00544'
Here is my query
mysql LOAD DATA LOCAL INFILE
'/usr/local/httpd/htdocs/projects/databases/tbl_ma
- INTO TABLE RecruiterConsole.tbl_mapZipCodes
- FIELDS TERMINATED BY ','
- OPTIONALLY ENCLOSED BY '\''
- LINES TERMINATED BY '\n'
- (mapCity,mapState,mapZip);
Here are the Results
Query OK, 20972 rows affected (1.56 sec)
Records: 20972 Deleted: 0 Skipped: 0 Warnings: 41943
I have tried a few different trouble-shooting scenarios and none seem to
work for me.
Anybody have any suggestions or similar experiences?
Thanks in advance.
Sean O'Donnell
Monrovia, CA.
[EMAIL PROTECTED]
http://dynamicwebdevelopers.com
-
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
-
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