Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
40 lines (40 sloc) 1.55 KB
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="">
<CodeSnippet Format="1.0.0">
<Title>Load and Read a Csv File</Title>
<Author>Matthias Shapiro</Author>
<Description>load and read a csv file</Description>
<Literal Editable="true">
<ToolTip>the name of the file we'd like to save this object into</ToolTip>
<Code Language="csharp"><![CDATA[// This snippet requires the CsvParse.cs file from
StorageFolder localFolder = ApplicationData.Current.LocalFolder;
var csvItem = await localFolder.TryGetItemAsync($filelocation$);
if(csvItem != null)
StorageFile file = await localFolder.GetFileAsync($filelocation$);
using (CsvParse.CsvFileReader csvReader = new CsvParse.CsvFileReader(await file.OpenStreamForReadAsync()))
CsvParse.CsvRow row = new CsvParse.CsvRow();
while (csvReader.ReadRow(row))
//use row[i] to reference a given column from the row