MySQL Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesMySQL Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 28th, 2000, 12:06 PM
ThePrezLee ThePrezLee is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2000
Location: London, UK
Posts: 2 ThePrezLee User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
can somebody please tell me where I am going wrong here?

I'm trying to import a CSV file into a table, but everytime I do it it puts eveything into only 2 fields (in the first record)

The command I'm using is...

mysqlimport -d -h localhost -p -u root -v database ~home/table.csv fields-terminated-by=,

a sample line from the csv would look like:

field1,field2,field3

please help!

Reply With Quote
  #2  
Old March 27th, 2000, 08:56 AM
tony styles tony styles is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2000
Posts: 10 tony styles User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Check carriage returns at the end of line.

<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by ThePrezLee:
can somebody please tell me where I am going wrong here?

I'm trying to import a CSV file into a table, but everytime I do it it puts eveything into only 2 fields (in the first record)

The command I'm using is...

mysqlimport -d -h localhost -p -u root -v database ~home/table.csv fields-terminated-by=,

a sample line from the csv would look like:

field1,field2,field3

please help!
[/quote]


Reply With Quote
  #3  
Old March 27th, 2000, 09:48 AM
ThePrezLee ThePrezLee is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2000
Location: London, UK
Posts: 2 ThePrezLee User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks, I actually solved this a few days after posting the message - a collegue wrote a program called "migrate" that does the job just fine

Reply With Quote
  #4  
Old April 14th, 2000, 11:47 AM
CAL128 CAL128 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2000
Posts: 4 CAL128 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Could you post the program to the board? (Provided it's a script and not compiled, of course!)

Chris

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMySQL Help > Help with importing CSV


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT