1

Am developing an wp7 application in that i need read the CSV file and store into list

the csv file is 20 lines with first name, last name separated by ,(comma)

and i tried to use http://kbcsv.codeplex.com/ this and http://www.codeproject.com/articles/25133/linq-to-csv-library when am tring to include those dlls am getting "windows phone projects will work only with windows phone assemblies" error

how can i parse csv file in windows phone 7

thanks in advance

sunny
  • 479
  • 1
  • 9
  • 18

1 Answers1

0

Use IsolatedStorageFileStream to get and open the file from saved path location. Then read with StreamReader object.

    IsolatedStorageFileStream fileStream = storage.OpenFile(filePath, FileMode.Open, FileAccess.Read);
    using (StreamReader reader = new StreamReader(fileStream))
    {
      string line;
      while ((line = reader.ReadLine()) != null)
      {
        string[] temp1Arr = line.Split(',');

        //Manipulate your string values stored in array here 
      }
    }

Hope it helps!

pan4321
  • 841
  • 1
  • 8
  • 17