# Importing excel or csv data to dataset tag practically

**URL:** <https://forum.inductiveautomation.com/t/importing-excel-or-csv-data-to-dataset-tag-practically/58279>\
**Category:** Ignition\
**Tags:** perspective, ignition81, scripting\
**Created:** [April 11, 2022, 10:34am UTC](https://forum.inductiveautomation.com/t/importing-excel-or-csv-data-to-dataset-tag-practically/58279 "2022-04-11T10:34:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![berkay.cinar](https://avatars.discourse-cdn.com/v4/letter/b/b9bd4f/32.png) [@berkay.cinar](https://forum.inductiveautomation.com/u/berkay.cinar)\
**Post date:** [April 11, 2022, 10:34am UTC](https://forum.inductiveautomation.com/t/importing-excel-or-csv-data-to-dataset-tag-practically/58279/1 "2022-04-11T10:34:10Z")

</div>

Hello,

I know this subject has been discussed before but I could not see a practical solution in those. I need to import 2 columns of data to a dataset tag. Since I am talking about plus 500 rows I am looking for easier way. How this can be done in most practical way?

Thanks

---

<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:** [April 11, 2022, 2:03pm UTC](https://forum.inductiveautomation.com/t/importing-excel-or-csv-data-to-dataset-tag-practically/58279/2 "2022-04-11T14:03:33Z")

</div>

Practical is in the eye of the beholder, but I figure a function would be a good place to start.

> [@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…

---

<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:** [April 11, 2022, 4:42pm UTC](https://forum.inductiveautomation.com/t/importing-excel-or-csv-data-to-dataset-tag-practically/58279/3 "2022-04-11T16:42:10Z")

</div>

One time, or continuously?

---

<div class="post-metadata">

**Author:** ![berkay.cinar](https://avatars.discourse-cdn.com/v4/letter/b/b9bd4f/32.png) [@berkay.cinar](https://forum.inductiveautomation.com/u/berkay.cinar)\
**Post date:** [April 12, 2022, 4:18am UTC](https://forum.inductiveautomation.com/t/importing-excel-or-csv-data-to-dataset-tag-practically/58279/4 "2022-04-12T04:18:34Z")

</div>

just once

---

<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:** [April 12, 2022, 3:15pm UTC](https://forum.inductiveautomation.com/t/importing-excel-or-csv-data-to-dataset-tag-practically/58279/5 "2022-04-12T15:15:48Z")

</div>

I would either manually adjust a CSV file to add the headers our dataset copy/paste format expects:  
[https://docs.inductiveautomation.com/display/DOC81/system.dataset.fromCSV](https://docs.inductiveautomation.com/display/DOC81/system.dataset.fromCSV)

Or leave it as a “plain” CSV file and just load and parse it with Python.
