Controlling the output format of numbers and NULL while exporting to CSV

How to ensure the numbers in CSV are 1 and not 1.

Data is imported from an excel, wherein they are detected as numbers and imported as 1., 2. etc. This poses a problem while exporting the again as csv

For example:

ExportString[
ImportString["a,b,c\n1.,NULL,d", "CSV"] (* emulating a import from excel
*),
"CSV"]


Gives the output as (which is written to the CSV file using Export["file.csv",Import["file.xls"]]):

"a","b","c"
1.,"NULL","d"


whereas the expected output is:

"a","b","c"
1,NULL,"d"


Is there a way to elegantly control such outputs/ behaviour of the CSV writer?

• ExportString[ ImportString[ StringReplace["a,b,c\n1.,NULL,d", ".," -> ","], "CSV"], "CSV"] – Bob Hanlon Feb 8 at 6:26