0

I have a sorted csv file. How to read just rows with ordered value and write them to datagridview.For example read just rows where value of Age is 22. the file looks like:

ID Name Surname Age Salary
1  John Asben   33  1000
2  Adam Smith   22  1200
3  Amanda J     22  2000
4  George Villis 36  2300
4
  • Just to be crystal clear, we will NOT write your code for you. So, that leads me to ask, what have you tried? Commented May 28, 2013 at 20:57
  • 2
    And how will you deal with "Billy Joe Smith" ? Commented May 28, 2013 at 20:58
  • 1
    Why not read the whole file, map it to a class and do the filtering there? Commented May 28, 2013 at 20:58
  • I have tryedDataRow[] foundRows; foundRows = dataSet1.Tables["Customers"].Select("Age Like 'A%'"); Commented May 29, 2013 at 20:18

1 Answer 1

1

About reading CSV files in .NET: Reading a CSV file in .NET?

Depending on the CSV parser type and the classes you'll get the CSV data in, you could apply a filter while parsing, apply a filter on the parsed data or add a View filter to the grid. I'm sure there are also other methods.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.