2008-04-03

Extracting contacts from a Nokia .nbu file

So, as any of you people with a Nokia Symbian phone should know, the Nokia PC Suite likes to make its backups in big blobs of data with file extension .nbu. Having recently switched (almost) completely to Fedora 8, and with Nokia PC Suite failing to even start its installer under Wine, let alone run, I had a backup file I couldn't use. A quick inspection failed to reveal this file as an ordinary archive, but a quick grep revealed uncompressed contacts engulfed in this nasty blob of phone data.

Now, my 6120 Classic recently cacked itself, and it's off at wherever Telstra sent it to for repairs. And I needed my contacts. So I thumbed my nose at the Real Hacker means of sh and perl, and wrote up a quick dirty python script to grab all contacts out of an .nbu file (in fact it will work on any file with uncompressed vcards in it). It IS quick and it IS dirty so don't expect fancy memory managing methods: it simply loads the whole file and regexps away (I had trouble with multiline Grepping. Yeah it could probably be done, yeah I'm a noob and the time to figure it out would be greater than the time to manually load up kwrite and copy each vcard out). So, if you have a 280MB nokia backup file, and 256MB ram, this could be Bad. Meh, try it anyway.

Gah, even the command arguments are hacked together.

Here's the script, it *should* run anywhere you can run Python (*Nix, Mac, Windows; even, amusingly, Symbian Series 60).

http://akdor1154.googlepages.com/vcfx.py

Welcome

This is not a blog. Well, clearly, it is. But it's not going to be used as a blog. It's more for the opportunity to post solutions to problems and projects I've attempted, so other people can gain the same knowledge. Comments to posts are welcome, that's why they're enabled, but there's no guarantee I'll reply or even notice them. I'll do my best, though.

-Jarrad