Learn how to write the code to read text from a file, and add LINQ expressions to filter the data retrieved based on the specified range of dates.
- [Instructor] Now that we're able to read each line of text…in the text file, we will start processing the data,…and the first instruction we were given…was to filter the data to a range of dates of interest,…and so let's go to our unit tests…and implement a filter on the source data.…So the unit test is ParseFilteredSampleFile.…Double-click the unit test to go to the source code,…and I'll just zoom back out to 100%,…and so here you can see a unit test…where I've placed some dates into variables,…just to give us a start and end date to work with.…
We're going to use a StreamReader()…to read from the file we've tested on before,…and we will skip the first line by saying,…text.ReadLine(), so ignoring the first line.…And now, we need to implement…WeatherData.ReadRange.…Previously, we said read all, we read all of the data…in the file, now we would like to apply a filter,…and so ReadRange() is still going to take text…as an input parameter, but then we would need…to provide a start and an end date…to filter which values we are actually interested in.…
Skill Level Intermediate
1. Problem 1: Pond Oreille
2. Problem 2: Where Am I?
3. Problem 3: Eight Queens
4. Problem 4: Accessing Peripherals
5. Problem 5: Facial Recognition
6. Problem 6: Real-Time Information Dashboard
Next steps2m 46s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.