the export of a SQL result to file (csv, excel, maybe xml) is trimmed. When exporting data it is essential that the value ' 1234' is not identical to '1234'. It seems that in the source a String.trim() is done for every output written.
I'm curious about your need for trimmed output, could you explain that further? I'm using it for export/import and especially key fields should not be trimmed as it is impossible to reimport the data.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
In some databases all datafields were defined as NOT NULL, so when there isn't really any data a space is saved in those string fields. I export a lot into spreadsheets and finding any of those "blank" fields turns out to be easy because SQuirreL already trimmed them. I only import very little data compared to the volume I export.
I agree that for keyfields it could be misleading, but in those databases I work with the keyfields are trimmed before saving.
As I wrote, it is sometimes practical, not always, so having it as an option would allow both ways, but if I had to choose from one fixed implementaion I would prefer it untrimmed as well.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Sometimes it even is practical. Can this be an export option?
I'm curious about your need for trimmed output, could you explain that further? I'm using it for export/import and especially key fields should not be trimmed as it is impossible to reimport the data.
In some databases all datafields were defined as NOT NULL, so when there isn't really any data a space is saved in those string fields. I export a lot into spreadsheets and finding any of those "blank" fields turns out to be easy because SQuirreL already trimmed them. I only import very little data compared to the volume I export.
I agree that for keyfields it could be misleading, but in those databases I work with the keyfields are trimmed before saving.
As I wrote, it is sometimes practical, not always, so having it as an option would allow both ways, but if I had to choose from one fixed implementaion I would prefer it untrimmed as well.
The trimming problem still exists if you save CSV or Excel.
On the other hand leading and trailing spaces are preserved if you save XML.
I would prefer an untrimmed export as the standard behaviour, too.
A trimming option in the export window would be nice, though.
I guess the trimming happens here:
Class "net.sourceforge.squirrel_sql.fw.gui.action.exportData.DataExportCSVWriter":
And here:
Class "net.sourceforge.squirrel_sql.fw.gui.action.exportData.DataExportExcelWriter":
Hope that helps.
Last edit: Chris B 2018-04-27