Zojak_Quaguz Posted January 4, 2011 Share Posted January 4, 2011 This one perplexes me. I can't find anything in the documentation about it, and I would be surprised if MySQL doesn't include functionality for such a simple task. LOAD DATA INFILE 'blah.txt' INTO TABLE blah FIELDS TERMINATE BY ' ' LINES TERMINATED BY '\n'; example file: 83726291 4 92923612 1 42093723 0 12321742 1 91283747 2 01249243 4 It keeps loading the entire line into a single field, so my table ends up with column 2 being NULL. Quote Link to comment https://forums.phpfreaks.com/topic/223368-how-to-import-a-white-space-delimited-text-file-using-load-data-infile/ Share on other sites More sharing options...
Zojak_Quaguz Posted January 4, 2011 Author Share Posted January 4, 2011 Ok, now it's working. No idea why it wasn't before. Quote Link to comment https://forums.phpfreaks.com/topic/223368-how-to-import-a-white-space-delimited-text-file-using-load-data-infile/#findComment-1154668 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.