Load data line break problem
"adrian GREEMAN" <[email protected]> Sun, 29 Oct 2006 14:42:19 -0000
| Newsgroups | gmane.comp.db.mysql.windows |
|---|---|
| Organization | Pix and Words |
| Message-ID | <000001c6fb68$7005b2b0$fd444654@ADRIAN1> |
I am trying to use LOAD DATA INFILE and have worked through various problems, e.g. that with version 5 you have to specifically enable the "local" variant in the security settings to use LOAD DATA LOCAL INFILE and that it helps to have slanted quotes around the database name etc (perhaps someone could remind me also of when these must be used and when it is not needed? Is it just around the database name or table names etc?) Anyway I loaded some data which includes long-ish strings. But--- Whenever these strings contain a line break, i.e. a \r\n paragraph sign, MYSQL is treating that as the end of a line in the data. It goes onto a new entry and of course the fields are all out of order and various nulls and such like get entered until that data item is exhausted. It then starts entering the data properly again from the next entry until it again encounters a line break within one of the text strings. But these breaks are within the string and within the quotes surrounding the string. I had assumed they would just be treated as part of the string and only line breaks outside quotes would be used to move onto new entries? But perhaps they have to be escaped in some way?? I cannot work this out from manual section on LOAD DATA - where else should I look or does anyone know the answer? Incidentally though I do not think this is the issue I should add that I am using Latin1 encoding for the data in the input file and the database is set up with UTF8 encoding. (But this seems to produce the correct result when I display the data - no odd characters displayed etc) so I assume the MySQL default is to read in as Latin1? Win XP SP2 Apache 1.3 MySQL5.0.21 Thanks Regards Adrian G -- MySQL Windows Mailing List For list archives: http://lists.mysql.com/win32 To unsubscribe: http://lists.mysql.com/[email protected]