question

Mischa Spelt avatar image
2 Likes"
Mischa Spelt asked Mischa Spelt commented

How to import CSV files with importtable()?

There seems to be a bug in the importtable where sometimes instead of a CSV (comma separated values), it imports a WSV (whatever-separator-you-have-in-Windows separated values). Actually, this is the same bug that Excel seems to have had for ages.

I created a CSV on my computer with international settings (using a comma between fields and a dot as decimal separator) and sent it to a customer with Dutch settings (using a semicolon between fields and a comma as decimal separator). So the importtable() command failed.

How can I make importtable() import actual comma separated values without creating a separate CSV source for each possible locale?

FlexSim 22.0.0
importtablecsv files
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

·
Jordan Johnson avatar image
1 Like"
Jordan Johnson answered Mischa Spelt commented

I'll add this to the dev list to look at and discuss. Off the top of my head, I'd say that it's tricky to make it work for all users in all cases. Our code has definitely been designed to look up locale information to parse CSV files. My guess is that a customer used excel to generate a locale-dependent csv file, and then requested that FlexSim be able to import it, without needing to change how they export from Excel. This is probably the most common case, where the writer and reader use the same locale. It seems like this case is less common, where the writer and reader have different locales.

That being said, this case may become more common, which is why it's worth some dev discussion. It would be nice to have a solution that let you import tables without caring about locale, somehow.

· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Mischa Spelt avatar image Mischa Spelt commented ·
Hi Jordan, thanks for considering this for discussion. Perhaps an optional second parameter to importtable (and exporttable?) would be sufficient to cover both use cases.
1 Like 1 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.