An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I have a csv file with hundreds of rows with 5 columns. Ofc the 1st row consists of the column names while the rest of the rows are the data.
What is the best way to parse and create entries while at the same time excluding some of the data if they don't meet a certain condition?
NuGet has CSV parsers. The official docs cover reading a text file and looping over each line. Split the line by the comma and apply whatever validation logic you require.
ok thanks, but where should the code for the parsing be written exactly?
In Web API custom code runs within an action invoked from an HTTP method (GET POST etc) Typically, the parsing logic exists in a class or library. The Web API action calls the class or library to perform the task. I think you'll be interested in going through a few Getting Started tutorials found on this site.
Sign in to comment