Reading From CSV and Putting in a List



I am working on a sample project where I am reading some values from a csv file, (Assume Column - first Name I want to read for all the rows and I want to put in a List and then want to compare with a variable for each value stored in the List. If matches then will perform some operation , if not, perform some other operation. I am done with reading CSV and performing the operations conditionally ( By Hard Coding some value in the comparing Variable) but unable to put the column values to the list so that it can be easier and dynamic. if any one has any example, please advise. Thanks so much.



It’s far easier to load a CSV File to a datatable and then loop through the datatable. No real need for a list here.

You can use For Each Row to loop through the datatable.

Plenty of examples on the forum