Sebastian wrote:
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;

Mediumtext can be too much, depending on the size of files you store. See http://dev.mysql.com/doc/mysql/en/string-types.html for more details about other *text data-types.

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

--
Nuno Pereira
email: [EMAIL PROTECTED]

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

Reply via email to