Sunday, February 26, 2012

Weddings with Awk, Latex and Google Docs

Hey guys, I'm getting married! Pretty sweet, right?

Like any good software developer, I am always trying to save myself boring work with scripts and tools. Sure it may end up taking more time, but it's more fun.

Anyway, I thought I'd share a little bit of our wedding workflow, since I think it has been pretty effective. It all starts off with a few Google docs. These documents are all shared, so both my fiance and I can update them at any point during the day. Those documents include a text file with ideas and tasks to be completed, along with a spreadsheet of the gifts we've received, who gave them and whether or not we'd sent them a thank-you. We don't want to forget anyone, nor forget what they gave!

But the most useful document has been a spreadsheet containing the guest list. In the row for each name we filled in their addresses as we received them along with a Y/N column indicating whether or not that person would have a 'plus one.' We were careful to put each piece of the address (street, city, state, ...) into its own column, which is helpful for the script I wrote later. We also had two Y/N columns indicating whether that person had been sent a save-the-date and an invitation.

Putting the addresses in a spreadsheet, as opposed to a Word document, is a great idea, because then it can be exported in CSV format, and I can write scripts over them. After exporting the guest list to CSV format, I wrote an Awk script that would go through the file and output a LaTeX file so that I could generate address labels. I used the "envlab" LaTeX package for generating the labels, and because I had saved each part of the address as its own column, it was easy to play around with alignments (e.g., "should the apartment number go on its own line or after the street?"). Also, I made the outputting of an address label conditional on the Y/N value in the column recording whether or not that person had already received an invitation. This was really useful, since we wanted to send out save-the-dates as soon as possible, even before we had addresses for everyone. So we could effectively run the script any time we wanted without having to worry about generating the same label twice. Finally, we printed the labels onto those standard Avery 5160 inkjet labels (or at least a compatible label). I happen to think that the clear labels look really good, and professional.

So that's it. Nothing particularly clever, but I kind of wanted to share my experiences. I think that overall we've saved a ton of time generating the labels this way. Certainly vs. writing them by hand, but even vs. using Word to create the labels.