# Importing Local CSV

**URL:** <https://forum.inductiveautomation.com/t/importing-local-csv/87650>\
**Category:** General Discussion\
**Tags:** perspective\
**Created:** [March 20, 2024, 6:20pm UTC](https://forum.inductiveautomation.com/t/importing-local-csv/87650 "2024-03-20T18:20:16Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![josborn](https://avatars.discourse-cdn.com/v4/letter/j/4bbf92/32.png) [@josborn](https://forum.inductiveautomation.com/u/josborn)\
**Post date:** [March 20, 2024, 7:23pm UTC](https://forum.inductiveautomation.com/t/importing-local-csv/87650/5 "2024-03-20T19:23:03Z")

</div>

I copied @Travis_Opperud's code from here, which quite nicely parses the csv from the file upload without needing to save the file to the gateway's disk.

> [@Upload csv to dataset](https://forum.inductiveautomation.com/t/upload-csv-to-dataset/79797/2):
>
> Figured it out, Not sure why I got hung up like I did. If anyone else gets stuck: the following class can parse csv files and store as a dataset: class CSVParser: def \_\_init\_\_(self, file\_in): self.file = file\_in self.file\_string = file\_in.getString() self.rows = [row.split(',') for row in self.file\_string.split('\r')] self.num\_cols = max([len(row) for row in self.rows]) self.num\_rows = len(self.rows) self.headers = self.rows[0] self.data = self.rows[1:] @property def extend…

---

_[View the full topic](https://forum.inductiveautomation.com/t/importing-local-csv/87650)._
