Hi everyone. I prepare a datafile using the advanced editor that comes with 7.3 and send it into a mysql table. I use tabs betwen fields and press enter between records. When I look at the table under mysql, I first get one field per line (as if I had pressed enter after each field) before I get my table as I wrote it. Can anyone help with this? Thanks, Steve.
On Tue, Mar 26, 2002 at 10:21:10AM +0100, steve wrote:
Hi everyone.
I prepare a datafile using the advanced editor that comes with 7.3 and send it into a mysql table. I use tabs betwen fields and press enter between records. When I look at the table under mysql, I first get one field per line (as if I had pressed enter after each field) before I get my table as I wrote it.
I always use commas if possible to delimit my fields. If that is not possible because the text fields have commas in them, I use something off the wall like '^'. Once you have your data clean, there are a couple of different ways to load it. I prefer to login to the mysql console and run: load data infile '/path/to/mydata.txt' into table mydata fields terminated by ','; The fields terminated by ',' is important so mysql knows how to interpret the data, in this example commas separate the fields. Best Regards, Keith -- LPIC-2, MSCE, N+ you may say I'm a dreamer, but I'm not the only one Got spam? Get SPASTIC http://spastic.sourceforge.net
participants (2)
-
Keith Winston
-
steve