# Semicolon instead of comma in Table exportToCSV?

**URL:** <https://forum.inductiveautomation.com/t/semicolon-instead-of-comma-in-table-exporttocsv/12438>\
**Category:** Ignition\
**Created:** [December 7, 2016, 12:52pm UTC](https://forum.inductiveautomation.com/t/semicolon-instead-of-comma-in-table-exporttocsv/12438 "2016-12-07T12:52:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![StefanGronberg](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/stefangronberg/32/6288_2.png) [@StefanGronberg](https://forum.inductiveautomation.com/u/StefanGronberg)\
**Post date:** [December 7, 2016, 12:52pm UTC](https://forum.inductiveautomation.com/t/semicolon-instead-of-comma-in-table-exporttocsv/12438/1 "2016-12-07T12:52:53Z")

</div>

Hi, i am exporting a table to CSV,  
But i have noticed that using a swedish Excel, all rows ends up in one column, instead of splitting up the data with the comma.  
In sweden we uses comma (,) to seperate decimals, and swedish Excel wont split when open an CSV-file that is comma-separated.

Can i get the export function to use semicolon instead?

[docs.inductiveautomation.com/display/DOC/Table](https://docs.inductiveautomation.com/display/DOC/Table)

Not OK format:

`"dateDay","OK","NOK","Total"
"2016-08-15","3","0","3"
"2016-08-16","5","11","16"
"2016-08-17","8","3","11"
"2016-08-18","11","2","13"`

OK format:

`"dateDay";"OK";"NOK";"Total"
"2016-08-15";"3";"0";"3"
"2016-08-16";"5";"11";"16"
"2016-08-17";"8";"3";"11"
"2016-08-18";"11";"2";"13"`

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [December 7, 2016, 4:40pm UTC](https://forum.inductiveautomation.com/t/semicolon-instead-of-comma-in-table-exporttocsv/12438/2 "2016-12-07T16:40:45Z")

</div>

You could work around this with the [system.dataset.toCSV](https://docs.inductiveautomation.com/display/DOC79/system.dataset.toCSV) function and some string replacement:

`table = #my component reference to a table
ds = table.data
csv = system.dataset.toCSV(dataset=ds, showHeaders=True, forExport=False)
csv = csv.replace('","', '";"')
path = system.file.saveFile("TableExport.csv")
if path != None:
   system.file.writeFile(path, csv)`

This is not perfect because if you had a string column with a value that contained a literal “,” in the data, it would break the comma to semicolon mapping, but this should do fine with the vast majority of data.

---

<div class="post-metadata">

**Author:** ![StefanGronberg](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/stefangronberg/32/6288_2.png) [@StefanGronberg](https://forum.inductiveautomation.com/u/StefanGronberg)\
**Post date:** [December 8, 2016, 1:36pm UTC](https://forum.inductiveautomation.com/t/semicolon-instead-of-comma-in-table-exporttocsv/12438/3 "2016-12-08T13:36:22Z")

</div>

Thanks, this worked as expected, and the texts and values will not have commas in them, values is always an integer in this case.
