Linux - Bteq - Export data to file - How can I remove the extra spaces?

Database

Linux - Bteq - Export data to file - How can I remove the extra spaces?

Using these settings the results of my SQL ran using Bteq is written to a file with no column headers, the only thing I can't figure out is how to get rid of the 10 spaces that are written to the export file before the results of the SQL.

.export data file=myFile.out
.set separator "|"
.set recordmode OFF
.set sidetitles OFF
.set TITLEDASHES OFF

For example if my SQL returns the number 4, my output file looks like:
SpaceSpaceSpaceSpaceSpaceSpaceSpaceSpaceSpaceSpace4
3 REPLIES

Re: Linux - Bteq - Export data to file - How can I remove the extra spaces?

use trim in the sql to avoid the extra spaces.
I think the column which you are trying to export in file is integer.
hope this works.

Re: Linux - Bteq - Export data to file - How can I remove the extra spaces?

I know, bteq can generate output files, but it's slow and not made for this kind of work.
Use fast export, extremely fast and easy to use.
By adding an Outmod function, you can have a pipe delimited file, without having a space in your output.

Re: Linux - Bteq - Export data to file - How can I remove the extra spaces?

The other way would be:

Select TRIM(col1)||','||TRIM(Col2)||','||TRIM(Col3)
FROM Table1;

Hope this helps.

Thanks