# Saving a DataSet as CSV File

A DataSet can be saved to the In-Sight vision system's file system, using the GetDataCsv and $System.File functions. This allows the tabular data to be stored and then utilized by a third party application to further process the tabular data.

Example

    myDataSet.AddRow([1251, "Data", true]);
    var csv_data = myDataSet.GetDataCsv(); //Convert the entire DataSet to the CSV file format
    $System.File.AppendText("mydata.txt", csv_data); //Append the entire DataSet to the text file
    var lastrow = myDataSet.GetRow(myDataSet. getRowCount() – 1)
    var csv_data = lastrow.GetDataCsv();
    $System.File.AppendText("mydata.txt", csv_data); //Append one row to the text file

Note: For more information about the $System.File functions, see the $ Functions: System topic.