How about piping your csv file through unix2dos?

-----Ursprüngliche Nachricht-----
Von: Peter Waller [mailto:pe...@scraperwiki.com]
Gesendet: Donnerstag, 24. Juli 2014 11:27
An: sqlite-users@sqlite.org
Cc: developers
Betreff: [sqlite] Producing RFC4180-compliant CSV output

Hi All,

We're using `sqlite -csv` to generate CSV files because it is the best 
performing thing available to us. It turns out however that the CSV spec 
demands CRLF line endings [1].

There is software in the wild that barfs on non-CRLF-line-ending files, such as 
SQL Server Integration Services [2].

Currently as best as we can tell from inspecting the source the output depends 
on the platform you run on, depending on what "text mode" means there. On Linux 
and on Windows using the official binaries, that means you get the wrong line 
endings (just 'plain' \n).

We have made a patch which works well in our environment which just makes CSV 
output \r\n instead of just \n. On Windows using the same compiler as the 
official binaries are built with the behaviour should be the same, but it may 
produce different output if a different compiler is used, because the behaviour 
of a file opened in text mode could vary.

Would a patch be accepted to change the line endings to \r\n?

Thanks,

- Peter

[1] http://tools.ietf.org/html/rfc4180#section-2
[2] https://en.wikipedia.org/wiki/SQL_Server_Integration_Services
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


-----------------------------------------------------------------------
Gunter Hick
Software Engineer

Scientific Games International GmbH
Klitschgasse 2 – 4, A - 1130 Vienna,
Austria
FN 157284 a, HG Wien
Tel: +43 1 80100 0
E-Mail: h...@scigames.at

This e-mail is confidential and may well also be legally privileged. If you 
have received it in error, you are on notice as to its status and accordingly 
please notify us immediately by reply e-mail and then
delete this message from your system. Please do not copy it or use it for any 
purposes, or disclose its contents to any person as to do so could be a breach 
of confidence. Thank you for your cooperation.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to