Forum Moderators: coopster

Message Too Old, No Replies

need help importing to mysql

need help importing to mysql

         

martin28

8:02 pm on Dec 19, 2003 (gmt 0)

10+ Year Member



I am trying to upload data to mysql but my hosting company has disabled load data infile, so I am trying to use a script.

The host provided me a script (kinsuth-mar.com/scripts/import.txt) that works fine for simple data, but if a field has a comma as part of the value, the program undestands that as a new field.

Example:

the data in excel is:

1¦numbers¦1,2,3¦basic
(4 fields)(the ¦ is just what I used here in the forum as tabs are not allowed)

thus, the generated csv file is
1,numbers,"1,2,3",basic
(4 fields)

However, the script understands the data as:

1¦numbers¦"1¦2¦3"¦basic
(6 fields)

So,
1) Does anybody know how to fix the script to let it understand that if a comma is within "", it shouldn't be interpreted as a field separator?
2) Also, if you know any other script that does what I am looking for please let me know.

3) Any other workarounds?

Thanks in advance,

Martin

[edited by: jatar_k at 11:20 pm (utc) on Dec. 19, 2003]
[edit reason] delinked [/edit]

henry0

10:25 pm on Dec 19, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Martin welcome on WebmasterWorld ground!

do a google search for "access to MYSQL"
that tool does exactly that

Henry

martin28

11:38 pm on Dec 19, 2003 (gmt 0)

10+ Year Member



Thanks but the program is for msaccess to sql, not excel to sql.

henry0

12:39 pm on Dec 20, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Well I guess that you use a MS machine with
"Office" installed on

you can very easily use your existing XL file to
export it as a "access" Db doc

then use the tool I mentioned

Henry