in Church, Computers, Life, Programming

(Re) Learning SQL

We have like 12 different databases at work. Most of them are Word documents. I’d like them all to be in (say) Excel files so that we can (for example) easily make mailing address labels. (Our current mailing label database started life that way, I think, but the Excel data has been lost, and the Word document with the mailing labels has been updated by hand ever since.)

This offends me. It drives me nuts. And in my copious spare time I’m trying to get them all into tabular data sets that can be imported into Excel. I’ve done most of that work, courtesy of antiword and a lot of ruby scripting.

Now I just need to merge columns A, C, and G from one file with columns B, T, and Q from another file. Times a dozen files. That, my friend, is a job for a database query language.

Back when I worked for the start-up, I used to know how those work. So now I’m dusting off what little I knew, and creating scripts to convert the tabular data files into SQL update commands I can send to a MySQL database.

Fun. But slow going. I expect to be done in September. November at the latest.

Update. In the ensuing six years, I had forgotten about the LOAD DATA command. Getting the data into tabular format (above) was all I needed to do. Cool.

This site uses Akismet to reduce spam. Learn how your comment data is processed.