Join Dan Gookin for an in-depth discussion in this video Coding a CSV to HTML table filter, part of Code Clinic: C.
- A filter is a program that reads standard input,…modifies that input,…and then generates standard output.…It's something the C language does really well,…and of all the code I've produced for this course,…I feel that my code for this solution…is the most C-like.…For this code, input must be chopped up…and based on how the text is terminated.…In a CSV file the terminators…are a comma for table cell,…and an end of line character for a table row.…Because output is determined by the terminator,…the input must be stored as it's received.…
Only when a terminating character floats in…can the code generate proper output,…say a table row instead of a table cell.…To store input,…I use a ring buffer…carefully called ring_buffer in the code.…The buffer size is set to 256 characters…which should be enough for a table cell,…and if not the constant size can be adjusted.…Two pointers start and end…track the ring buffer.…A while loop reads standard input.…For the first row,…starting HTML table tags are output.…
Otherwise, the terminating character in the CSV file…
Dan introduces challenges and then provides an overview of his solutions in C. Challenges include topics such as statistical analysis, searching directories for images, and accessing peripheral devices.
Skill Level Beginner
Q: I am unable to access the Lake Pend Oreille data from outside the U.S.
A: A static copy of this data is provided here for lynda.com members outside of the U.S.
1. Problem One: Exploring Lake Pend Oreille
2. Problem Two: Image Analysis
3. Problem Three: Eight Queens
4. Problem Four: Accessing Peripherals
5. Problem Five: Recursion and Directories
6. Problem Six: Building the Web
- 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.