SheetJS / sheetjs

📗 SheetJS Spreadsheet Data Toolkit -- New home https://git.sheetjs.com/SheetJS/sheetjs
https://sheetjs.com/
Apache License 2.0
35.12k stars 8k forks source link

thousand separator #2556

Open reviewher opened 7 years ago

reviewher commented 7 years ago

from https://github.com/SheetJS/js-xls/issues/102 reported by @tburd

Hi All.
First I would like to thank all users and admins here, The code is awesome.

I am facing am issue while loading files with "thousands".
I am from Brazil, using brazilian formatation, but I don´t know if this is the issue.

As you see below the thousand numbers are being displayed in the output as "2,590".
That´s ok, I can live with it, although when I try to separate all colaumns by comma, I split the number.
Is it possible to change the column separator from , to ; ?

Regards.

29/07/16 15:00,CX. Test,10,"2,590","7,770",78,,,
29/07/16 13:00,Test,143,766,"2,298",329,60,2%,
29/07/16 17:00,Composta,231,730,"2,190",506,60,2%,
29/07/16 19:00,Composta,263,510,"1,530",402,32,2%,
29/07/16 21:00,Composta,313,561,"1,683",527,55,2%,
29/07/16 23:00,Composta,354,535,"1,605",568,50,2%,
snoopyjc commented 4 years ago

This looks like CSV output and you need to properly interpret it as in quotes, the commas are not separators. Try using the csv module instead of just using str.split(',').