Re: help with load from file

2003-05-28 Thread trogers
We, ok.  Thank you all.
This worked quite nicely and I learned something to boot!
TR

On Tuesday, May 27, 2003, at 11:00 PM, Steve Gums wrote:

The numbers should be without the quotes and the end of line character 
can
stay as is.
Once you have this you should be able to do something like this.

load data local infile 'path to infile' into table table name 
fields
terminated by ',' optionally enclosed by '';

This is what I used and it worked very well.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 27, 2003 8:31 PM
To: MySQL List
Subject: Re: help with load from file
I also have it prepared like this:

1,Mac,SE30,314784,LOV,115,,,
2,Mac,Performa6300CD,338211,LOV,109,,,


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


help with load from file

2003-05-27 Thread trogers
Hi,

I have a text file where lines look like this:

3   Mac Performa6300CD  338211  LOV 109 \   \   \  
 
4   Mac G3BT/266350755  LOV 003 \   9.1 104.103
Except they are not wrapped like in this email!
Each column is separated by a 'tab' (at least I think so).
The \ character represents data I don't know (null).
I have created a db and a table where I would like to upload the data; 
the table has 9 filelds; the data in the rows, like row 3 and row 4 
above (3  4 is also part of the data, the record_id), are in the same 
order as the fields occur in the table.  The table fields are setup 
with types and so on.

How do I get this data in there?  I think I am missing somethings?
(I'm trying to do it with phpMyAdmin but I can do it from CLI if 
someone would be so kind as to show me?)

Thank you,
Ted
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Re: help with load from file

2003-05-27 Thread Martin Gainty
Ted-
check out 
http://www.mysql.com/doc/en/LOAD_DATA.html
(go to mysql prompt and issue command LOAD DATA INFILE)
keeping attention to format for INFILE
Hth,
Martin
- Original Message - 
From: [EMAIL PROTECTED]
To: MySQL List [EMAIL PROTECTED]
Sent: Tuesday, May 27, 2003 9:25 PM
Subject: help with load from file


 Hi,
 
 I have a text file where lines look like this:
 
 3 Mac Performa6300CD 338211 LOV 109 \ \ \ 
 4 Mac G3BT/266 350755 LOV 003 \ 9.1 104.103
 
 Except they are not wrapped like in this email!
 Each column is separated by a 'tab' (at least I think so).
 The \ character represents data I don't know (null).
 
 I have created a db and a table where I would like to upload the data; 
 the table has 9 filelds; the data in the rows, like row 3 and row 4 
 above (3  4 is also part of the data, the record_id), are in the same 
 order as the fields occur in the table.  The table fields are setup 
 with types and so on.
 
 How do I get this data in there?  I think I am missing somethings?
 (I'm trying to do it with phpMyAdmin but I can do it from CLI if 
 someone would be so kind as to show me?)
 
 Thank you,
 Ted
 
 
 -- 
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
 
 

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: help with load from file

2003-05-27 Thread trogers
I also have it prepared like this:

1,Mac,SE30,314784,LOV,115,,,
2,Mac,Performa6300CD,338211,LOV,109,,,
Also, I did have all the \ as \N previously.

But what about at the end of lines.  What I had with \N wouldn't take 
so I was hoping someone might out what the error might be coming from 
by looking a few of my lines?

And to Martin:  I actually, for once, DID look at the manual there 
before I wrote.  I was really hoping someone could show me just one 
proper line and the syntax to upload it.  :-(

Thanks,
Ted
p.s. writing a script for me is not simple!  ;-)  I only this one with 
about 100 entries and I'm done, I do want to learn by it though and get 
it in there using some kind of text file.

On Tuesday, May 27, 2003, at 09:32 PM, Steve Gums wrote:

I know I will get ridiculed for this but you could write a rather 
simple awk
script to print this data comma delimited with  for strings and turn 
the \
into \N for MySQL and that should import rather well.
But like I said I am sure someone out there has a much better solution 
then
the one I mentioned.

Steve

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 27, 2003 7:26 PM
To: MySQL List
Subject: help with load from file
Hi,

I have a text file where lines look like this:

3   Mac Performa6300CD  338211  LOV 109 \   \   \
4   Mac G3BT/266350755  LOV 003 \   9.1 104.103
Except they are not wrapped like in this email!
Each column is separated by a 'tab' (at least I think so).
The \ character represents data I don't know (null).
I have created a db and a table where I would like to upload the data;
the table has 9 filelds; the data in the rows, like row 3 and row 4
above (3  4 is also part of the data, the record_id), are in the same
order as the fields occur in the table.  The table fields are setup
with types and so on.
How do I get this data in there?  I think I am missing somethings?
(I'm trying to do it with phpMyAdmin but I can do it from CLI if
someone would be so kind as to show me?)
Thank you,
Ted


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Re: help with load from file

2003-05-27 Thread trogers
Yes, I simply don't understand this:
===
LOAD DATA [LOW_PRIORITY | CONCURRENT] [LOCAL] INFILE 'file_name.txt'
[REPLACE | IGNORE]
INTO TABLE tbl_name
[FIELDS
[TERMINATED BY '\t']
[[OPTIONALLY] ENCLOSED BY '']
[ESCAPED BY '\\' ]
]
[LINES
[STARTING BY '']
[TERMINATED BY '\n']
]
[IGNORE number LINES]
[(col_name,...)]
==
Help?
Ted

On Tuesday, May 27, 2003, at 09:35 PM, Martin Gainty wrote:

Ted-
check out
http://www.mysql.com/doc/en/LOAD_DATA.html
(go to mysql prompt and issue command LOAD DATA INFILE)
keeping attention to format for INFILE
Hth,
Martin
- Original Message -
From: [EMAIL PROTECTED]
To: MySQL List [EMAIL PROTECTED]
Sent: Tuesday, May 27, 2003 9:25 PM
Subject: help with load from file

Hi,

I have a text file where lines look like this:

3 Mac Performa6300CD 338211 LOV 109 \ \ \
4 Mac G3BT/266 350755 LOV 003 \ 9.1 104.103
Except they are not wrapped like in this email!
Each column is separated by a 'tab' (at least I think so).
The \ character represents data I don't know (null).
I have created a db and a table where I would like to upload the data;
the table has 9 filelds; the data in the rows, like row 3 and row 4
above (3  4 is also part of the data, the record_id), are in the same
order as the fields occur in the table.  The table fields are setup
with types and so on.
How do I get this data in there?  I think I am missing somethings?
(I'm trying to do it with phpMyAdmin but I can do it from CLI if
someone would be so kind as to show me?)
Thank you,
Ted