Importing data

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ITCraze
    New Member
    • Nov 2007
    • 19

    Importing data

    Hey everyone:

    I just want to discuss the problem releted to ASP.NET 2005 and MySQL database.I have a text file with delimiter as space.Now I want to import the text file data into MySQL database.Suppos e text file contains :

    sdf dfdsf dfdsf

    Now in the database I have three fields , so above text file data should go to the database in particular fields.

    I have used LOAD DATA INFILE 'pathname' into table table name fields terminated by ' ' lines terminated by '\n';

    But the problem is that I am getting the data but it is not going to the correct fields.But if I will use comma delimiter ,it works almost perfect.So, please tell me what I should do whether convert the text file into csv file or do something as you all can suggest.

    About converting into csv file , I don't know how to convert that text file into csv file.

    Please help , it is very urgent!!
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    save the data in a notepad ans save with extension of .CSV. Save under all file s with file name within "" .

    Comment

    Working...