Answers for "hwo to read csv"

3

how to read a csv file in c#

using System.IO;

static void Main(string[] args)
{
    using(var reader = new StreamReader(@"C:test.csv"))
    {
        List<string> listA = new List<string>();
        List<string> listB = new List<string>();
        while (!reader.EndOfStream)
        {
            var line = reader.ReadLine();
            var values = line.Split(';');

            listA.Add(values[0]);
            listB.Add(values[1]);
        }
    }
}
Posted by: Guest on October-09-2020
0

how to read a csv file in python

import csv
with open('some.csv', newline='') as f:
    reader = csv.reader(f)
    for row in reader:
        print(row)
Posted by: Guest on May-14-2021

Python Answers by Framework

Browse Popular Code Answers by Language