Why, yes, I *am* a huge nerd.

(Or, how catching up on Doctor Who led me to awk programming.)

I rarely watch television, but when I do, I tend to “read” the shows in some detail. I watch the episodes on DVD, and I break them down to cards as I do so. I take notes as I go, noting the main story beats and act breaks. At the end of each episode, I write a single-paragraph synopsis (analysis) and a single-paragraph review (opinion). Later, I do a little mini-essay on the overall arc (and, yes, structure) of the season.

Obviously, that’s pretty time-consuming, so I have made some effort to make the workflow as efficient as possible. Indeed, I actually have already partially automated the process, crafting a bash script for each DVD set that:

  1. Calls dvdbackup for each disc in the set.
  2. Invokes mencoder for triple-pass encoding of episodes into individual (and much smaller) AVI files using the Xvid codec.
  3. Deletes the original DVD backups.
  4. Creates a skeleton text file in AsciiDoc for each series, season and episode being processed.
  5. Writes wrapper scripts for each episode.

The end result is that when it’s time to watch, say, “Blink”, all I have to do is type ~/action/review/doctor-who/310 at the terminal prompt. The script will open my notes to the right place in vim and then start the video in mplayer.

Now, this seems perfectly straightforward to me. Indeed, thanks to tab-completion and a logical home directory structure modeled on GTD, running these scripts requires essentially no thought on my part. However, there is definitely something wrong with writing lots of very similar one-off scripts to set all this up in the first place. I’m not much of a programmer, but I do recognize the basic problem: stupid repetitive work.

My solution? I’m currently trying to learn AWK (actually, gawk) to automate the whole process based on just a tab-delimited text file that describes each season. If it works, I’ll have written a single, easily extended, data-driven program that writes programs to call programs.

Why, yes: I am a huge nerd.