- As I studied this problem, the solution became obvious:
I would create a filter.
The CSV file would supply the input;
and the filter would generate an HTML table as the output.
The resulting program, CSV to HTML,
works not only with the sample files,
but with any file formatted with comma-separated values.
The program features a help switch,
which displays the full options.
The HTML switch generates full HTML output,
which is basically the header and body tags.
Specify the header switch when the CSV file contains
a header row.
If so, the table header tags are used for that row.
To generate the HTML table for the assignment,
you redirect input from a CSV file, such as first_semester.
The table generated uses all caps tags,
although I could fix that in the code.
The tags are indented by using tab characters.
Because this CSV file contains a header row,
you can specify the header switch.
And I'll scroll back.
And there are the header tags in the output
for the first row of cells.
I'm going to specify the HTML switch
and process the second_semester file.
Here, you see additional HTML tags:
the HEAD; a META tag to identify the author;
and the BODY tag, along with the TABLE.
This is all very primitive, but it works quite well.
In fact, I ran one of my own CSV files
through the filter; the file had seven columns
and about a hundred rows,
and the CSV to HTML filter converted all of that
into neatly formatted HTML.
In the next movie, I'll show in detail how the code works.