mols2grid icon indicating copy to clipboard operation
mols2grid copied to clipboard

Change CSV delimiter to a comma

Open nithishbn opened this issue 1 year ago • 1 comments

Having a semicolon as the delimiter feels a little unorthodox for a CSV. Having it be a comma makes it easier to load into various applications without an explicit delimiter.

nithishbn avatar Nov 07 '24 19:11 nithishbn

Hi and thanks for the contribution!

It's unorthodox indeed, but in a lot of European countries the comma is often used for decimal points so a semicolon ends up being used as delimiter for CSVs in a lot of applications. Ideally we would change the delimiter based on the locale being used, something like:

import locale
decimal_point = locale.localeconv()['decimal_point']
delimiter = ';' if decimal_point == ',' else ","

and use that instead

cbouy avatar Nov 13 '24 00:11 cbouy