# Scripted file browser

**URL:** <https://forum.inductiveautomation.com/t/scripted-file-browser/11815>\
**Category:** General Discussion\
**Created:** [June 15, 2016, 7:32pm UTC](https://forum.inductiveautomation.com/t/scripted-file-browser/11815 "2016-06-15T19:32:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![joe.miller](https://avatars.discourse-cdn.com/v4/letter/j/b4bc9f/32.png) [@joe.miller](https://forum.inductiveautomation.com/u/joe.miller)\
**Post date:** [June 15, 2016, 7:32pm UTC](https://forum.inductiveautomation.com/t/scripted-file-browser/11815/1 "2016-06-15T19:32:46Z")

</div>

I am exporting a csv file, making changes to it, then importing it back in.

I am using the following code to bring the csv back in. Where do I find information on creating a file browser so I do not always have to have the file saved as a specific name, with a specific path?

Below is my current code:

#Specify file path  
file\_path = “C:\reciperesults.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(‘New Recipe Creation Table’).data = data

---

<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:** [June 16, 2016, 11:56am UTC](https://forum.inductiveautomation.com/t/scripted-file-browser/11815/2 "2016-06-16T11:56:44Z")

</div>

Hi Joe, welcome to the forums! 🙂  
system.file.saveFile() is the function you’re looking for.

`#Specify file path
file_path = system.file.saveFile("reciperesults.csv")
if filepath != None:
  #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('New Recipe Creation Table').data = data`

---

<div class="post-metadata">

**Author:** ![joe.miller](https://avatars.discourse-cdn.com/v4/letter/j/b4bc9f/32.png) [@joe.miller](https://forum.inductiveautomation.com/u/joe.miller)\
**Post date:** [June 16, 2016, 1:24pm UTC](https://forum.inductiveautomation.com/t/scripted-file-browser/11815/3 "2016-06-16T13:24:10Z")

</div>

great! It works well, thank you. I am new to ignition and to python.

I had one issue where you used filepath, instead of file\_path. Good exercise for me to interpret the error message though!!
