0

I want to LOAD DATA from text file some columns in row having more than 4000 characters, which is breaking as next line. Even I if open notepad the data in there also showing as next line and having some space in some places.

Not sure, do I need to fix the text file or load data command. It is a windows server. Any suggestions pls?

Input file text: I have hidden the words, I cannot capture everything from notepad, since I did not used word warp. You can see ID ex: 9,10,11. For characters I have used longtext data type for all columns.

enter image description here

enter image description here

For more: MYSQL LOAD DATA INFILE LINES TERMINATED BY not working

enter image description here

Link

10
  • I don't think LOAD DATA will break long lines unless you are loading them into, say a column that is VARCHAR(4000). Load into TEXT or MEDIUMTEXT instead. If that does not explain it, then I need something other than an unreadable image.
    – Rick James
    Dec 22, 2022 at 5:50
  • Or maybe you are saying that a "column" does have "newlines" in it (like a bunch of paragraphs)? Have you tried something other than \n, \r\n, ||| for LINES TERMINATED BY`? Or maybe that is what you mean by notepad.
    – Rick James
    Dec 22, 2022 at 5:52
  • Sorry you are not on Linux; there is a simple sed command.
    – Rick James
    Dec 22, 2022 at 5:53
  • 1
    Even I if open notepad the data in there also showing as next line and having some space in some places. Does it only shows these linebreaks but they are not present in the file really? Try the next: create a table with autoincremented PK and one data column of LONGTEXT datatype and load your file into it, then look at the data imported - does the imported lines which are divided to a lot of rows are absent?
    – Akina
    Dec 22, 2022 at 7:24
  • Thanks Akina and Rick James for the assistance. Dec 22, 2022 at 8:24

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.