# Reading from CSV file

**URL:** <https://forum.inductiveautomation.com/t/reading-from-csv-file/65111>\
**Category:** Ignition\
**Tags:** ignition81, scripting, perspective\
**Created:** [October 12, 2022, 1:20pm UTC](https://forum.inductiveautomation.com/t/reading-from-csv-file/65111 "2022-10-12T13:20:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tadeja.saje](https://avatars.discourse-cdn.com/v4/letter/t/b782af/32.png) [@tadeja.saje](https://forum.inductiveautomation.com/u/tadeja.saje)\
**Post date:** [October 12, 2022, 1:20pm UTC](https://forum.inductiveautomation.com/t/reading-from-csv-file/65111/1 "2022-10-12T13:20:03Z")

</div>

Hello,  
I have Ignition Perspecive 8.2.  
Could be transform from string to dataset with function `system.dataset.fromCSV()` the latest `n` rows(from end)?

```auto
data_string = system.file.readFileAsString(filepath)
data1= "#NAMES"+"\n"+"timestamp,bazen" +"\n"+"#TYPES"+"\n"+ "date;D"+ "\n"+"#ROWS;3000"+"\n"+ data_string 
data2 =data1.replace(";",",")
data3 = system.dataset.fromCSV(data2)``
```

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [October 12, 2022, 1:38pm UTC](https://forum.inductiveautomation.com/t/reading-from-csv-file/65111/2 "2022-10-12T13:38:10Z")

</div>

> [@tadeja.saje](#):
>
> Ignition Perspecive 8.2

Take a closer look at your version number, since that one doesn't exist and will not exist. (IA announced that they will be skipping over v8.2 to v8.3 late next year or early 2024.)

To your question: consider using a library to read your CSV line by line, keeping the last 20, then converting to dataset at the end.
