Just a little nit on the code for your Generalizing example.
In the data freqs2 step. The line:
ID = substr(Table, 6);
should probably be
ID = substr(Table, 7);
to avoid picking up the blank before the "ID" that you are looking for.

This is a great article.