Results 1 to 2 of 2
  1. #1
    Join Date
    May 2014

    Red face Unanswered: Load data local infile


    I have a file with following format.
    #*Multimedia Document Search on the Web.
    #@Giuseppe Amato,Fausto Rabitti,Pasquale Savino
    #cComputer Networks

    #*Priorities in WLANs.
    #@Imad Aad,Claude Castelluccia
    #cComputer Networks

    how to I load it using a load data local infile query ?
    Each row is a column starting with a specific identifier. for e.g, * is title, @ is author, t is year.

  2. #2
    Join Date
    Nov 2004
    out on a limb
    Provided Answers: 59
    short of reprocessing the file I doubt you will be able to load that directly using 'infile'

    it should be easy enough to knock it into shape with a file editor

    #* is the start of a book entry
    #! is the end
    an insert statement takes the form of

    insert into mytable (column1, column2,column3...columnN) Values (value1, value2, value3...valueN)

    insert into mytable (title, author, PubIndex, publisher.......) values ('Multimedia Document Search on the Web.', 'Giuseppe Amato,Fausto Rabitti,Pasquale Savino', 1998, 'Computer Networks', '793168',NULL)
    the main problems are going to be
    making certain that all text values are delimited appropriately
    carriage returns / linefeeds are removed

    some of that depends ont he editor you are using

    if that doeswn't work then you should be able to get the same effect by knocking up a quick and dirty program in something liek VB Script, PHP, Pythin or whatever your weapon of choice for such tasks is

    different OS's use different symbols to represent a CR & / or LF int he windows world its the ASCII representation of 10 & 13
    some OS's use only CR or only LF
    I'd rather be riding on the Tiger 800 or the Norton

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts