This code will convert a CSV file to a Ignition Dataset.
def readCsvAsDataSet(path):
from java.io import BufferedReader,FileReader,File
from system.dataset import toDataSet
br = BufferedReader(FileReader(path))
line = br.readLine()
headers = line.split(',')
line = br.readLine()
data = []
while line != None:
data.append(line.split(','))
line = br.readLine()
return toDataSet(headers,data)
To use it, you would do something like
path = system.file.saveFile(".csv")
dataset = app.file.readCsvAsDataSet(path)
event.source.getComponent("Table").data = dataset