I am using a SQL statement to write data to CSV file.
The sql statement starts with
SELECT "PRESV01" AS [#DL], PHDCFG_UF_TAGSYNC_STAGE.TAGNAME AS Item,
The header in the CSV file must start with #DL to allow successful import in destination program.
For some reason the created CSV file does not start with #DL in header, but with .DL
Does anyone knows the reason why # is replaced with . in the CSV file?
How is the data getting from your SELECT query into the file? Perhaps whatever utility / program is actually exporting the data to the CSV file is making that change from "#" to "." ?
I faced a similar issue where I had to provide data to a vendor application that required specific column header values. We were using SSRS to export the data to CSV but I don't see how you can't use a similar solution where the client application complains about the values in your headers.
Select your column headers then union the actual values such as this:
SELECT ColumnHeader1, ColumnHeader2, ColumnHeader#
UNION ALL
SELECT ColumnValue1, ColumnValue2, ColumnValue3
Then turn off the column header values in the export file and the first SELECT statement gives you the "header" values you need.
You may have to fight with data type issues. If you can turn it into a VIEW it helps too. It allowed us to solve our problem of providing header values that were normally not supported.