Re: LOAD DATA INFILE question...
Somewhere about Sat, 20-Nov-2004 at 06:27PM +0100 (give or take), Ferhat BINGOL wrote: | Hi, | | I have a 72 fields data txt file and I was inserting all data | previously but now I need only some of them to dump into the table. | I would like to select only 4 fields which are the 1st, 5th,28th | and 71st fields. | Is there a statement to do that. | I think it would be simpler to pre-process the file using cut with the appropriate delmiter if it's not tab-delimited already. Then import the reduced file. HTH -- ___ Patrick Connolly {~._.~} _( Y )_ Good judgment comes from experience (:_~*~_:) Experience comes from bad judgment (_)-(_) -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
[solved] Re: LOAD DATA INFILE question...
Hi Patrick, I was doing that it was taking 20 seconds to chop the fields from the file. That was the problem. Meanwhile about my problem I have seen that the lines in data files end with \r\n not \n so it solved the problem. Now it takes 3 seconds to dump the file and chop the necassary fields. thanks to MySQL. :) thank yo again for answer... - Original Message - From: Patrick Connolly [EMAIL PROTECTED] To: Ferhat BINGOL [EMAIL PROTECTED] Cc: mysql [EMAIL PROTECTED] Sent: Sunday, November 21, 2004 10:00 AM Subject: Re: LOAD DATA INFILE question... Somewhere about Sat, 20-Nov-2004 at 06:27PM +0100 (give or take), Ferhat BINGOL wrote: | Hi, | | I have a 72 fields data txt file and I was inserting all data | previously but now I need only some of them to dump into the table. | I would like to select only 4 fields which are the 1st, 5th,28th | and 71st fields. | Is there a statement to do that. | I think it would be simpler to pre-process the file using cut with the appropriate delmiter if it's not tab-delimited already. Then import the reduced file. HTH -- ___ Patrick Connolly {~._.~} _( Y )_ Good judgment comes from experience (:_~*~_:) Experience comes from bad judgment (_)-(_) -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
LOAD DATA INFILE question...
Hi, I have a 72 fields data txt file and I was inserting all data previously but now I need only some of them to dump into the table. I would like to select only 4 fields which are the 1st, 5th,28th and 71st fields. Is there a statement to do that. I have read http://dev.mysql.com/doc/mysql/en/LOAD_DATA.html but could not find it... Thanks...
Re: LOAD DATA INFILE question...
You can load the file to an intermediate table and then complete your process using INSERT INTO targetTable SELECT col_1, col_5, col_28, col_71 FROM intermediateTABLE Ferhat BINGOL wrote: Hi, I have a 72 fields data txt file and I was inserting all data previously but now I need only some of them to dump into the table. I would like to select only 4 fields which are the 1st, 5th,28th and 71st fields. Is there a statement to do that. I have read http://dev.mysql.com/doc/mysql/en/LOAD_DATA.html but could not find it... Thanks... -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: LOAD DATA INFILE question...
what about the file size. My file size is 10 mb. When I dump them all with LOAD DATA INFILE I only get first 9800 raws which is size of 2.9 mb. Is there a limit for file size? Where can I increase it? Regards.. - Original Message - From: Victor Pendleton [EMAIL PROTECTED] To: Ferhat BINGOL [EMAIL PROTECTED] Cc: mysql [EMAIL PROTECTED] Sent: Saturday, November 20, 2004 10:41 PM Subject: Re: LOAD DATA INFILE question... You can load the file to an intermediate table and then complete your process using INSERT INTO targetTable SELECT col_1, col_5, col_28, col_71 FROM intermediateTABLE Ferhat BINGOL wrote: Hi, I have a 72 fields data txt file and I was inserting all data previously but now I need only some of them to dump into the table. I would like to select only 4 fields which are the 1st, 5th,28th and 71st fields. Is there a statement to do that. I have read http://dev.mysql.com/doc/mysql/en/LOAD_DATA.html but could not find it... Thanks... -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
load data infile question
I haven't used load data infile much, mainly because of issues like this question. I want to load a bunch of data for our data warehouse into about 10 different tables. But when I load a parent table, an auto_increment column autogenerates a value that will be a foreign key in a child table. So i cant create the file to load into the child table until after the parent table has been loaded. Then i'll need to get back all the auto increment values just created, and put them into the load file for the child tables. Is this how it has to be, or am i missing something? thanks much sean peters [EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
RE: load data infile question
For this type of custom loading you may want to explore a programming language such as Java or C/C++ or Perl. Depending on your platform you could even explore some third party tools. -Original Message- From: sean c peters To: [EMAIL PROTECTED] Sent: 8/4/04 3:27 PM Subject: load data infile question I haven't used load data infile much, mainly because of issues like this question. I want to load a bunch of data for our data warehouse into about 10 different tables. But when I load a parent table, an auto_increment column autogenerates a value that will be a foreign key in a child table. So i cant create the file to load into the child table until after the parent table has been loaded. Then i'll need to get back all the auto increment values just created, and put them into the load file for the child tables. Is this how it has to be, or am i missing something? thanks much sean peters [EMAIL PROTECTED] -- 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: load data infile question
sean c peters wrote: But when I load a parent table, an auto_increment column autogenerates a value that will be a foreign key in a child table. So i cant create the file to load into the child table until after the parent table has been loaded. Then i'll need to get back all the auto increment values just created, and put them into the load file for the child tables. If no one else is going to be adding rows to the tables while you're doing the loading, then you can make your own values for the auto_increment column and include them in the text file rather than letting MySQL generate them. Just find the max current value and start counting from there, and using the same values in the child tables. I do something similar for one of my databases, and it works because there's no other process for inserting rows into those tables. That may not apply to your situation, though. -- Keith Ivey [EMAIL PROTECTED] Washington, DC -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
load data infile question
In MYSQL documentation the following line is Some cases are not supported by LOAD DATA INFILE: 1. Fixed-size rows( FIELDS TERMINATED BY and FIELDS ENCLOSED BY both empty) and BLOB or TEXT columns I defined a column in a table as type TEXT. I then loaded values using LOAD DATA INFILE into the table. Since I was able to load data for a TEXT column, what does the above statement mean.. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: load data infile question
[EMAIL PROTECTED] wrote: In MYSQL documentation the following line is Some cases are not supported by LOAD DATA INFILE: 1. Fixed-size rows( FIELDS TERMINATED BY and FIELDS ENCLOSED BY both empty) and BLOB or TEXT columns I defined a column in a table as type TEXT. I then loaded values using LOAD DATA INFILE into the table. Since I was able to load data for a TEXT column, what does the above statement mean.. Well, when loading a single column table, there are no field separators. The line terminator is sufficient. Try defining a table with more than one field, and see what happens. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
re: RE: load data infile question
On Tuesday 25 March 2003 19:54, Salada Duncan wrote: I was able to work around the problem by giving insert privileges to the user for the WHOLE database. This is definitely not optimal because I only wish this user to be able to insert into one table in the database. But as soon as I gave the user insert privileges for the whole database the load data infile command worked. This seems like a bug to me, perhaps it has been dealt with in newer versions though. It works fine for me on 3.23.56. Could you upgrade MySQL server and test on the 3.23.56? -- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Victoria Reznichenko / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net ___/ www.mysql.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
RE: RE: load data infile question
-Original Message- From: Victoria Reznichenko [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 26, 2003 6:55 AM To: [EMAIL PROTECTED] Subject: re: RE: load data infile question Hi! On Tuesday 25 March 2003 19:54, Salada Duncan wrote: I was able to work around the problem by giving insert privileges to the user for the WHOLE database. This is definitely not optimal because I only wish this user to be able to insert into one table in the database. But as soon as I gave the user insert privileges for the whole database the load data infile command worked. This seems like a bug to me, perhaps it has been dealt with in newer versions though. It works fine for me on 3.23.56. Could you upgrade MySQL server and test on the 3.23.56? Thanks for the suggestion to upgrade Victoria. It jogged my memory that our development server had a copy of 3.23.54 (we recently upgraded it to 4.0.12 in prepration for moving to 4 for production). I fired up 3.23.54, and everything worked as planned. So, it seems this isn't a problem in 3.23.54. Sorry to take up your time. Duncan --- Duncan Salada Titan Systems Corporation 301-925-3222 x375 -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
RE: load data infile question
Just an update... I was able to work around the problem by giving insert privileges to the user for the WHOLE database. This is definitely not optimal because I only wish this user to be able to insert into one table in the database. But as soon as I gave the user insert privileges for the whole database the load data infile command worked. This seems like a bug to me, perhaps it has been dealt with in newer versions though. Duncan --- Duncan Salada Titan Systems Corporation 301-925-3222 x375 -Original Message- From: Salada, Duncan [mailto:[EMAIL PROTECTED] Sent: Monday, March 24, 2003 11:08 AM To: 'Victoria Reznichenko'; [EMAIL PROTECTED] Subject: RE: load data infile question -Original Message- From: Victoria Reznichenko [mailto:[EMAIL PROTECTED] Sent: Monday, March 24, 2003 9:06 AM To: [EMAIL PROTECTED] Subject: re: load data infile question Hi! On Friday 21 March 2003 20:41, Salada Duncan wrote: I am using MySQL 3.23.49 and have started having a problem with the load data infile command. I recently created a new user with select,insert,update,and delete on one table only (tableA). Because I want the user to be able to use load data infile to load records into tableA, I also gave it the file privilege on a global scale (which is the only way to do it AFAIK). Yet when I attempt to use load data infile FILE into tableA after having connected using the mysql client, I get an access denied message. Is there something else I need to do? Some other pertinent info... - Yes, I have flushed privileges after giving privileges - I know load data infile works (in general) because I have another user that could do it without any trouble. You must have FILE privilege to use LOAD DATA INFILE. Do you have this privilege? Yes, I have the FILE privilege. Duncan --- Duncan Salada Titan Systems Corporation 301-925-3222 x375 -- 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: load data infile question
On Friday 21 March 2003 20:41, Salada Duncan wrote: I am using MySQL 3.23.49 and have started having a problem with the load data infile command. I recently created a new user with select,insert,update,and delete on one table only (tableA). Because I want the user to be able to use load data infile to load records into tableA, I also gave it the file privilege on a global scale (which is the only way to do it AFAIK). Yet when I attempt to use load data infile FILE into tableA after having connected using the mysql client, I get an access denied message. Is there something else I need to do? Some other pertinent info... - Yes, I have flushed privileges after giving privileges - I know load data infile works (in general) because I have another user that could do it without any trouble. You must have FILE privilege to use LOAD DATA INFILE. Do you have this privilege? -- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Victoria Reznichenko / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net ___/ www.mysql.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
RE: load data infile question
-Original Message- From: Victoria Reznichenko [mailto:[EMAIL PROTECTED] Sent: Monday, March 24, 2003 9:06 AM To: [EMAIL PROTECTED] Subject: re: load data infile question Hi! On Friday 21 March 2003 20:41, Salada Duncan wrote: I am using MySQL 3.23.49 and have started having a problem with the load data infile command. I recently created a new user with select,insert,update,and delete on one table only (tableA). Because I want the user to be able to use load data infile to load records into tableA, I also gave it the file privilege on a global scale (which is the only way to do it AFAIK). Yet when I attempt to use load data infile FILE into tableA after having connected using the mysql client, I get an access denied message. Is there something else I need to do? Some other pertinent info... - Yes, I have flushed privileges after giving privileges - I know load data infile works (in general) because I have another user that could do it without any trouble. You must have FILE privilege to use LOAD DATA INFILE. Do you have this privilege? Yes, I have the FILE privilege. Duncan --- Duncan Salada Titan Systems Corporation 301-925-3222 x375 -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
load data infile question
Hi everyone, I am using MySQL 3.23.49 and have started having a problem with the load data infile command. I recently created a new user with select,insert,update,and delete on one table only (tableA). Because I want the user to be able to use load data infile to load records into tableA, I also gave it the file privilege on a global scale (which is the only way to do it AFAIK). Yet when I attempt to use load data infile FILE into tableA after having connected using the mysql client, I get an access denied message. Is there something else I need to do? Some other pertinent info... - Yes, I have flushed privileges after giving privileges - I know load data infile works (in general) because I have another user that could do it without any trouble. Duncan --- Duncan Salada Titan Systems Corporation 301-925-3222 x375 - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: load data infile question
What's the error you're getting? What OS are you running on? If it's *nix, make sure the file you are trying to load, and the full path to that file, is readable by the user mysql runs as. I once had some files in a user's home directory I was trying to load and although the file was world-readable, the directory permissions restricted access. --jeff - Original Message - From: Salada, Duncan [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, March 21, 2003 10:41 AM Subject: load data infile question Hi everyone, I am using MySQL 3.23.49 and have started having a problem with the load data infile command. I recently created a new user with select,insert,update,and delete on one table only (tableA). Because I want the user to be able to use load data infile to load records into tableA, I also gave it the file privilege on a global scale (which is the only way to do it AFAIK). Yet when I attempt to use load data infile FILE into tableA after having connected using the mysql client, I get an access denied message. Is there something else I need to do? Some other pertinent info... - Yes, I have flushed privileges after giving privileges - I know load data infile works (in general) because I have another user that could do it without any trouble. Duncan --- Duncan Salada Titan Systems Corporation 301-925-3222 x375 - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
sql query LOAD DATA INFILE question
sql,query Hi, I am looking at the following situation: I am reading some files arriving every minute and parsing them and creating a set of files ready to be inserted into tables. on the fly. While I am waiting for the next burst of files, I want to insert these into the tables, then erase the files. Normally LOAD DATA INFILE LOCAL works fine here. The problem is that the machine holding these tables is a different one. The question is, is it possible to run LOAD DATA INFILE to do the inserts on the remote machine, or is it better to first ftp the files over, then run LOAD DATA INFILE there? I assume LOAD INFILE is faster than via mysql -u user -ppasswd DBfile.sql where file.sql contains sql INSERT query From the LOAD DATA INFILE documentation it is not clear to me how this can be done, if it can be done. Thanks, - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
re: sql query LOAD DATA INFILE question
On Tuesday 17 December 2002 11:08, moka at hol dot gr wrote: I am looking at the following situation: I am reading some files arriving every minute and parsing them and creating a set of files ready to be inserted into tables. on the fly. While I am waiting for the next burst of files, I want to insert these into the tables, then erase the files. Normally LOAD DATA INFILE LOCAL works fine here. The problem is that the machine holding these tables is a different one. The question is, is it possible to run LOAD DATA INFILE to do the inserts on the remote machine, or is it better to first ftp the files over, then run LOAD DATA INFILE there? I assume LOAD INFILE is faster than via mysql -u user -ppasswd DBfile.sql where file.sql contains sql INSERT query From the LOAD DATA INFILE documentation it is not clear to me how this can be done, if it can be done. If you use LOAD DATA LOCAL INFILE, file must be located on the client box. So, you can load data to the remore server. ftp is faster, more reliable, but LOAD DATA LOCAL is easier to use and cheaper. Besides, to use LOAD DATA you should have FILE privilege. -- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Victoria Reznichenko / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net ___/ www.mysql.com - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: load data infile question
Hi, Harpreet: You should use MySQL C API mysql_escape_string(...) to convert that description field into a legal SQL string before load data infile. B.R. budingc - Original Message - From: Harpreet Kaur [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, March 27, 2002 4:41 AM Subject: load data infile question I want to transfer data from a table in sql server to mysql. I use C:\ BCP dbname.dbo.tblname out tblname.txt -S srvrname -U sa P sapwd -c -t \t -r \n to write the data to a text file and then use load data infile ?var/www/html/tblname.txt' into table tblname; It works fine for all the tables except this one table which has description field with several lines. It assumes each line as a seperate field rather then one field and so create errors. Please help. Regards Harpreet _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp. - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
load data infile question
I want to transfer data from a table in sql server to mysql. I use C:\ BCP dbname.dbo.tblname out tblname.txt -S srvrname -U sa P sapwd -c -t \t -r \n to write the data to a text file and then use load data infile /var/www/html/tblname.txt' into table tblname; It works fine for all the tables except this one table which has description field with several lines. It assumes each line as a seperate field rather then one field and so create errors. Please help. Regards Harpreet _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp. - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: load data infile question
At 20:41 + 3/26/02, Harpreet Kaur wrote: I want to transfer data from a table in sql server to mysql. I use C:\ BCP dbname.dbo.tblname out tblname.txt -S srvrname -U sa P sapwd -c -t \t -r \n to write the data to a text file and then use load data infile /var/www/html/tblname.txt' into table tblname; It works fine for all the tables except this one table which has description field with several lines. It assumes each line as a seperate field rather then one field and so create errors. Please help. You have set yourself an impossible task. You have a data file in which the the line terminator occurs internally to certain field values. The terminator is thus ambiguous. If you can, create the file so that the internal line separator characters are written using \n or \r or \r\n sequences (whatever your terminator is, I don't know what BCP is, so I can't tell what your command means). Regards Harpreet - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
LOAD DATA INFILE Question
I have a text file with around 25 fields but I only want 5 of them. They are not the first 5 fields that I want. Is there a way to skip fields using LOAD DATA INFILE so I don't have to build a 25 field table and then cut it down? Thanks, Curtis - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: LOAD DATA INFILE Question
On Tue, 4 Sep 2001, Curtis Spencer wrote: I have a text file with around 25 fields but I only want 5 of them. They are not the first 5 fields that I want. Is there a way to skip fields using LOAD DATA INFILE so I don't have to build a 25 field table and then cut it down? Read the manual for LOAD DATA INFILE; look at the part where it says IGNORE. You can tell it to IGNORE the first 5 lines. - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: LOAD DATA INFILE Question
At 12:45 PM -0700 9/4/01, Curtis Spencer wrote: I have a text file with around 25 fields but I only want 5 of them. They are not the first 5 fields that I want. Is there a way to skip fields using LOAD DATA INFILE so I don't have to build a 25 field table and then cut it down? Thanks, Curtis No. You can write a short program that strips out the extraneous columns. Or, depending on what platform you're using and the format of your data, you may be able to use a standard utility (such as cut on Unix). What kind of machine are you using? -- Paul DuBois, [EMAIL PROTECTED] - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
LOAD DATA INFILE Question
Ok, the company I work for does not host its own websites, etc.. we pay a company for space on their servers. They use Unix boxes and the database they support is MySQL with a PHPMyAdmin GUI. Here is my dillema.. I need to move some of our existing Microsoft (Excel and Access) databases to MySQL on the server so that we can incorporate them into our websites. I appreciate the feedback I have gotten and I understand now that this is ultimately a function of the LOAD DATA INFILE syntax. What I need to know, though, is what would the syntax be to pull the text file off of my C: drive and into the MySQL table on our remote server? This is all soo confusing. Chris G. --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.256 / Virus Database: 129 - Release Date: 5/31/2001
load data infile question
I have a one time load of an extremely large file. It's a tab delimited file, the problem I'm getting is importing the following field. C:\Borland\server\bin\gbak.exe- The field how it looks on the import file (it's delimited by tabs) C:Borlandserver ingbak.exe - How it looks once it is imported into MySql Between the "ver ing" there is a tab character that I can't get to show on this e-mail I think it's interpreting the \b (from server\bin) as a tab character or something. Without editing the entire file how can I get around this problem? I would also like to see the '\' in the database if possible. Following is the load statement that I am using for loading the data. load data local infile "e:/data_in/keyaudit.kau" into table tbl_KeyAudit; MySql version is 3.23.28-gamma-debug Debra Samsom Bristol Aerospace Ltd. (204) 775-8331 3402 [EMAIL PROTECTED] - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php