TabularData DataFrame writeCSV changes double to string for numbers >= 1000

The TabularData DataFrame writeCSV method formats Double (and possibly Integer) numbers that are >= 1000 with a comma thousands separator and surrounds the output in double quotes. Numbers less than 1000 are not double-quoted. If the resulting CSV file is then read by DataFrame contentsOfCSVFile an error is thrown, i.e. a type mismatch. This happens irrespective of whether the types option is set in the CSV read, or not.

There is no option in DataFrame writeCSV to specify no thousands separator, nor any other obvious way of preventing the double-quoting.

Currently, I "fix" the problem by reading the CSV in Numbers, setting the faulty column(s) to Numeric then exporting back to CSV.

Any thoughts on preventing the issue in the first place?

Answered by Frameworks Engineer in 680291022

Thanks for reporting this issue, we are looking into it.

Accepted Answer

Thanks for reporting this issue, we are looking into it.

Fixed as of Xcode 13.0 beta 3 (13A5192j) and MacOS 12.0 Beta 21A5284e ( don't know about iOS etc, haven't tried yet). Thank you Engineers.

Regards, Michaela

TabularData DataFrame writeCSV changes double to string for numbers >= 1000
 
 
Q