Re: How to avoid stumbling over empty lines in csv data loader
Daniel Dekany <[email protected]> Wed, 1 Mar 2006 12:50:06 +0100
| Newsgroups | gmane.comp.text.fmpp |
|---|---|
| Message-ID | <[email protected]> |
Sunday, February 26, 2006, 12:03:41 PM, Daniel Dekany wrote: > Sunday, February 26, 2006, 11:35:23 AM, Ralf Hauser wrote: > >>> > Thanks, if would be great if that wasn't just >>> > "ignoreTrailingEmptyLines", but "ignoreEmptyLinesInAnyPosition"! >>> Empty lines at the end of a file can occur accidentally, but in the >>> middle of the CSV file? How could that happen? >> In many ways, not the last being the user, adding some <#-- --> >> comments or <!-- --> or "#" to the input file or whatever reason... > > (We are talking about CSV files... if somebody adds FTL or HTML > comments to a CSV file in the belief that those will be ignored, > that's really a situation that can't be handled.) > >> I guess, if you are taking care of it, why not make it robust even to that case as well >>> I want to schedule the .11 release after the FreeMarker 2.3.5 release, >>> which is planned be done next week, but who knows. Anyway, I will >>> create a qfix jar if this CVS thing is done. >> CSV or CVS? > > CSV. > >> Sounds good - I'll try to make a CVS-HEAD build, once you say it is ready. I have looked into this csv VS trailing empty lines issue (didn't committed anything yet). I have found that it already ignores the last empty line, since MS Excell puts a linebreak after the last row of you save in csv or txt format, and surely I have considered that format as the de-facto standard when I made the cvs data loader. Now, some tools (like CVS as far as I know) like to add a line break at the end of the text files, but only of there is no line-break there already. Thus, if they add that line-break, then there will be only 1 empty line at the end of the cvs file, that the data loader *do* ignore. So what's the problem exactly in your case? There are 2 empty lines at the end of the file? How? -- Best regards, Daniel Dekany ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642