the example i just showed you doesn't need to use delimited syntax. it will load the entire contents of the file into the column you specify.. try it a test:

CREATE TABLE `table_test` (
 `content` mediumtext NOT NULL
) ENGINE=MyISAM;

create a txt file 'data.txt' with some text, then run query:

LOAD DATA INFILE '/path/to/data.txt' INTO TABLE table_test (content);

P.S. click 'reply all' so others on the list can see the messages.


Gregory Machin wrote:

Sorry for not clarifying, I have looked into LOAD DATA INFILE '/path/to/data.txt' INTO TABLE tb1
(col1,col2,...);
but by my understanding it only works for delimited text files, the
text files are html and php web pages that need to be migrated to
CMS.When i tried with one file i ended up with 24 empty fields in the
column..

On 7/21/05, Sebastian <[EMAIL PROTECTED]> wrote:
what you mean by "whole txt" the entire contents of the file or the
actual file itself?

to load the contents in it:

LOAD DATA INFILE '/path/to/data.txt' INTO TABLE tb1 (col1,col2,...);

otherwise the column has to be blob type, using normal insert query:
INSERT INTO table VALUES (data...)

Gregory Machin wrote:

Hi all
How does one save a whole txt file in a largetext column ?
Ihave found l lots  on delimited filesbut non on saving a whole text file .

Many thanks


--
Certified E-mail - No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.336 / Virus Database: 267.9.2/54 - Release Date: 7/21/2005


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






--
Certified E-mail - No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.336 / Virus Database: 267.9.2/54 - Release Date: 7/21/2005


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

Reply via email to