Professional Web Applications Themes

Loading into a TABLE - MySQL

Hello, I am new to MySQL. I am trying to load from a text file to a table, and am having problems with the fields in the text file being translated to the correct fields in the TABLE. Right now, I have a tab between each field in the text file, something like: Chicago USA North America New York USA North America Madrid Spain Europe My question: Can I use something else to differentiate between fields, like a coma? So that my input file would look like: Chicago,USA,North America New York,USA,North America Madrid,Spain,Europe If I can use this approach, how ...

  1. #1

    Default Loading into a TABLE

    Hello,

    I am new to MySQL. I am trying to load from a text file to a table,
    and am having problems
    with the fields in the text file being translated to the correct fields

    in the TABLE. Right now,
    I have a tab between each field in the text file, something like:

    Chicago USA North America
    New York USA North America
    Madrid Spain Europe

    My question: Can I use something else to differentiate between fields,
    like a coma? So that my input file would look like:

    Chicago,USA,North America
    New York,USA,North America
    Madrid,Spain,Europe

    If I can use this approach, how do I specify it in my LOAD statement?
    If I cannot, what would be a solution?

    Thank you for your time.

    D-

    Dan J. Guest

  2. #2

    Default Re: Loading into a TABLE

    Hi,

    the LOAD DATA INFILE command (or the mysqlimport command - they do basically
    the same) are what you're looking for:

    [url]http://dev.mysql.com/doc/refman/5.0/en/load-data.html[/url]

    [url]http://dev.mysql.com/doc/refman/5.0/en/mysqlimport.html[/url]

    Markus


    Markus Popp Guest

Similar Threads

  1. loading dynamic xml table cells / layout / and functions
    By urbanrevolution in forum Macromedia Flash Data Integration
    Replies: 2
    Last Post: October 20th, 06:04 PM
  2. Replies: 1
    Last Post: June 23rd, 12:08 AM
  3. loading only few rows from huge table
    By Mark in forum PostgreSQL / PGSQL
    Replies: 2
    Last Post: December 29th, 05:38 PM
  4. How would i go around loading a table?
    By Gabbagod webforumsuser@macromedia.com in forum Macromedia Flash Actionscript
    Replies: 0
    Last Post: February 3rd, 05:43 PM
  5. Replies: 2
    Last Post: August 12th, 07:55 AM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139