[Patch] CSV export doesn't quote memo fields
Original Reporter info from Mantis: BigChimp
-
Reporter name: Reinier Olislagers
Original Reporter info from Mantis: BigChimp
- Reporter name: Reinier Olislagers
Description:
If you have memo fields in your dataset, using e.g. LazDBExport tools to export to CSV leads to memo output that is not enclosed by quotes when required.
Steps to reproduce:
- Open demo project.
- Click export, then
- Comma-Separated Values
- Enter a filename, e.g. test.csv
- Tab formatting, quotestrings, set qsAlways to true
- Click ok
Resulting export shows:
- The second column is an ftMemo field; this is not quoted.
- The "Trillian "Forgot the rest" McM" field could have been doublequoted
e.g. "Trillian ""Forgot the rest"" McM", but this depends on the kind of CSV you expect
Additional information:
I've attached a patch for fpcsvexport.pp that:
- quotes not only string but also memo and blob type fields if required
- sets quoting defaults more sensibly (no quoting=>quote spaces and delimiters)
but I'm doing something stupid as it doesn't seem to have any effect.
Mantis conversion info:
- Mantis ID: 19759
- OS: Vista
- Build: FPC git 17 July 2011
- Platform: Windows
- Fixed in version: 3.0.0
- Fixed in revision: 21490 (#f97c4b7b)
- Target version: 2.6.1