using (StreamReader sr = new StreamReader(CSVFilePathName)) { while (!sr.EndOfStream) { if (sr != null) { strData = File.ReadLines(CSVFilePathName).ElementAt(lineno).Split(','); } } }
Code is as below: <pre> using (StreamReader sr = new StreamReader(CSVFilePathName)) { while (!sr.EndOfStream) { if (sr != null) { strData = File.ReadLines(CSVFilePathName).ElementAt(lineno).Split(','); }
StreamReader
using (StreamReader sr = new StreamReader(CSVFilePathName)) { string line; while ((line = sr.ReadLine()) != null) { strData = line.Split(','); for (int i = 0; i < strData.Length; ++i) { strData[i] = strData[i].Trim(); } // ... } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)