Hello,
I am new to C# , how can I open and read .csv file and store it as an array in Console application using c#.
thanks .
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Rajeesh MenothRank #118 · 18.4K reputationPosted Oct 5, 2015, 10:13 AM EDT
using System.IO; static void Main(string[] args) { var reader = new StreamReader(File.OpenRead(@"C:\test.csv")); List listA = new List(); List listB = new List(); while (!reader.EndOfStream) { var line = reader.ReadLine(); var values = line.Split(';'); listA.Add(values[0]); listB.Add(values[1]); } }solya merto3 reputationPosted Oct 5, 2015, 10:29 AM EDT