Re: How load a tab delimited file into my MySQL da tabase via PHPMyAdmin?
|
Indira Sivan |
|
10/30/2008 4:13:54 AM |
Hi Larry, you might have to do some funky 'find and replace' on that string... break out excel?
MSSql Server deals with these imports very nicely... Not so sure MySQL has a straight forward solution to it though.. not much help. Sorry Post Comments |
|
Indira, Thanks anyway. I'm nearly there now. TAB is \t and my line terminator is wrong. Think it's \r only. Trying now... Post Comments |
|
Re: How load a tab delimited file into my MySQL da tabase via PHPMyAdmin?
|
August Buell |
|
10/30/2008 4:15:07 AM |
Hi Larry, Read the file with line I/O into an array.
Then parse each element of the array(each line) with explode.
$exploded[0] $exploded [1] etc make up each data element for the insert.
Opps, not php...
You need to define a column for each data element across the line horizonatally. I thought, without looking, delimiter was a checkbox? Post Comments |
|
Re: I found a nice script
|
Larry Coons |
|
10/30/2008 4:17:36 AM |
August, I found a nice script once which does this exlpoding and inserting for you but lost it. This LOAD business has always been cumbersome but it looks like I've cracked it not (can't tell quite yet though, large files!).
UPDATE: Done! \t for field delimiter and \n linefeed for row delimiter did the trick. Post Comments |
|
Re: Good job, glad to hear it.
|
August Buell |
|
10/30/2008 4:18:54 AM |
Good job, glad to hear it.
Post Comments |
|