Using C# to search a CSV file and pull the value in the column next to it

Use a CSV library for reading CSV files. I like this one https://joshclose.github.io/CsvHelper/

Reading CSV files is not as straightforward as it seems. The number one difficulty is that values can have commas in them. The steps are simply, make a C# class to hold your data, map it to the data you see in your CSV file, and call the CSV library. That page I linked has enough examples to show you how to do this.

Leave a Comment