load data infile somewhat flaky
DFS <[email protected]> Tue, 17 Aug 2021 13:11:14 -0400
| Newsgroups | comp.databases.mysql |
|---|---|
| Organization | blocknews - www.blocknews.net |
| Message-ID | <[email protected]> |
Finally got a big file (3 columns x 612K rows) of messy data loaded. load data infile 'file.csv' into table fields terminated by ',' enclosed by '"'; I noticed it tells you an error occurred at a certain line, but the offending data (a text field ending in \ or "\") 5 lines later was the real issue. On one run 5 lines didn't post, and it turns out they were the next 5 lines after a field ending in "\". Those 5 lines got concatenated with the offending line, so I had one large clump of data in one row. Moral: watch for fields ending in \ or "\".