Ignore empty lines in CSV import?
| User, date | Message |
|---|---|
|
Written by JanSR
6 years ago Category: Import/Export 5 posts since Thu, 26 Oct 06 |
I have an excel-sheet, which I need to save as CSV and then import in to mySQL via Heidi. Sadly the Excel-Sheet seems to contain loads more "Returns" than it has lines, all of these get imported into mySQL obviously. Would it be possible to add an option in the "import csv"-Settings to say "ignore empty lines"? This would - if checked - just import lines that actually contain more than just field-terminators and line breaks. ? Jan |
|
Written by ansgar
6 years ago 3974 posts since Fri, 07 Apr 06 |
Unfortunately the LOAD DATA-syntax does not allow ignoring specific lines. Only a fixed number of top-lines can be ignored by "IGNORE X LINES". See here: http://dev.mysql.com/doc/refman/5.0/en/load-data.html LOAD DATA [LOW_PRIORITY | CONCURRENT] [LOCAL] INFILE 'file_name' That means we would have to first manipulate the file, maybe save a temporarily copy of it and then fire the LOAD-command. Could be good. We should submit a tracker-item at http://rfe.heidisql.com/ |
|
Written by siMKin
6 years ago 104 posts since Sun, 01 Apr 07 |
while you're at it, maybe you could also consider adding a replace functionality through regular expressions :) i have never had the need for it, but i can imagine it might be useful for some. |
|
Please login to leave a reply, or register at first. |