# Convert Excel data on a Tag Dataset ignition

**URL:** <https://forum.inductiveautomation.com/t/convert-excel-data-on-a-tag-dataset-ignition/79016>\
**Category:** Ignition\
**Created:** [September 12, 2023, 1:54pm UTC](https://forum.inductiveautomation.com/t/convert-excel-data-on-a-tag-dataset-ignition/79016 "2023-09-12T13:54:38Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![sebastien\_ng](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/sebastien_ng/32/55297_2.png) [@sebastien\_ng](https://forum.inductiveautomation.com/u/sebastien_ng)\
**Post date:** [September 12, 2023, 1:54pm UTC](https://forum.inductiveautomation.com/t/convert-excel-data-on-a-tag-dataset-ignition/79016/1 "2023-09-12T13:54:38Z")

</div>

Hello, I need help.  
I'am creating a webcam system. All data of a webcam will be configured on an Excel file like:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/b/2b0d7210e98a423e9550d9876fd843b937d7d85e.png)

I would like to know if it is possible to extract my data excel below and write it like a tag dataset.

To do the test, I created a tag dataset like:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/4/444881dcf5c6ed6fe53759076539ab0099d2ff16.png)

But in future, all configuration of webcam will be donne in a Excel file  
the raison that is why I'am searching solution to get Read an Excel file and whrite data on a tag.

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [September 12, 2023, 2:19pm UTC](https://forum.inductiveautomation.com/t/convert-excel-data-on-a-tag-dataset-ignition/79016/2 "2023-09-12T14:19:59Z")

</div>

If you can format/convert your excel to csv, you can use this:  
[https://docs.inductiveautomation.com/display/DOC81/system.dataset.fromCSV](https://docs.inductiveautomation.com/display/DOC81/system.dataset.fromCSV)

Otherwise you might be able to use `org.apache.poi.ss`

---

<div class="post-metadata">

**Author:** ![sebastien\_ng](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/sebastien_ng/32/55297_2.png) [@sebastien\_ng](https://forum.inductiveautomation.com/u/sebastien_ng)\
**Post date:** [September 12, 2023, 2:43pm UTC](https://forum.inductiveautomation.com/t/convert-excel-data-on-a-tag-dataset-ignition/79016/3 "2023-09-12T14:43:44Z")

</div>

j'ai pris l'exemple du doc

```auto
# In this example it is assumed that the CSV file being read was a dataset
#that was previously exported using system.dataset.toCSV with the forExport flag set to True:
# Specify file path.
file_path = "C:\\my_dataset.csv"
# Read in the file as a string.
data_string = system.file.readFileAsString(file_path)
# Convert the string to a dataset and store in a variable.
data = system.dataset.fromCSV(data_string)
# Assign the dataset to a table.
event.source.parent.getComponent('Table').data = data

```

Mais s'affiche l'erreur.

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/5/e59f7acc33714ed1be637943ae76f633587f0860.png)

fichier .csv:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/f/5f24172fa9413fe8db049d8f6cd8c33bf24c805e.png)

---

<div class="post-metadata">

**Author:** ![sebastien\_ng](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/sebastien_ng/32/55297_2.png) [@sebastien\_ng](https://forum.inductiveautomation.com/u/sebastien_ng)\
**Post date:** [September 12, 2023, 2:44pm UTC](https://forum.inductiveautomation.com/t/convert-excel-data-on-a-tag-dataset-ignition/79016/4 "2023-09-12T14:44:24Z")

</div>

> [@pascal.fragnoud](#):
>
> org.apache.poi.ss

Concernant cette bibliothèque, comment l'implémenter sur ignition

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [September 12, 2023, 2:46pm UTC](https://forum.inductiveautomation.com/t/convert-excel-data-on-a-tag-dataset-ignition/79016/5 "2023-09-12T14:46:25Z")

</div>

> [@sebastien\_ng](#):
>
> j'ai pris l'exemple du doc

Pas tout à fait.

Le message d'erreur dit qu'il ne trouve que 4 rows, alors qu'il en attend 6.  
Regarde bien ton csv:

> `ligne 5: #ROWS, 6`

Et derrière, il n'y a que 4 lignes... Forcément, ca marche pas.

> [@sebastien\_ng](#):
>
> Concernant cette bibliothèque, comment l'implémenter sur ignition

`import org.apache.poi.ss`

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [September 12, 2023, 8:21pm UTC](https://forum.inductiveautomation.com/t/convert-excel-data-on-a-tag-dataset-ignition/79016/6 "2023-09-12T20:21:00Z")

</div>

To help you get started:

> [@Copying an Excel file to a table's dataset](https://forum.inductiveautomation.com/t/copying-a-excel-file-to-a-tables-dataset/34942/13):
>
> Got my paperwork done early, so here's a sample to read from an Excel file EDIT: Reworked a bit to work with both .xls and .xlsx files EDIT: Modified to properly cast data types EDIT: Added handler for formula cell types EDIT: Added parameters to optionally specify sheet, row, and column numbers Reading back a file created from my other example: def excelToDataSet(fileName, hasHeaders = False, sheetNum = 0, firstRow = None, lastRow = None, firstCol = None, lastCol = None): import org.apac…
