OCBackup

From Theory of Measurements Wiki

Jump to: navigation, search

Windows Mobile 5 contact backup utility

I was using an HP iPAQ hw6915 as my primary phone for quite some time but wanted to buy something 3G, so I bought an LG KU250 to replace it. Well, the LG's charger almost caught fire (just made some odd noises, turned really hot and smelled bad, and didn't charge as well) so I returned that and bought a Nokia 6233 instead. But that's another story.

I didn't even want to install Outlook to back up the HP and try to restore the backup onto another phone using some other software, so I wrote a small utility to make a vCard backup of all the contacts on the HP. The result is a file named backup.vcf, stored in the root of the filesystem on the WM5 device. The file contains all contacts from the WM5 device in one large vcard file. At least the LG phone thought it was a real contacts backup file and restored all contacts from the file. My Nokia phone didn't want to do that, but the contacts could be restored anyway by splitting up the large vcf file so that the contact cards were saved in individual files and copied to the mobile unit using the Nokia PC Suite.

By the way, the utility makes CSV files as well.

Get the utility as a VS2005 project and as a .NET CF binary from here.

The Python code below splits the VCF file containing many contacts into individual VCF files (feed the VCF file from stdin):

#!/usr/bin/python
import sys,os
shit=[x.strip() for x in sys.stdin.readlines()]
vc=""
c=0
fn=""
for x in shit:
    vc+=x+"\r\n"
    if x.startswith("N;CHA"):
        fn="%s.vcf"%x.split(';')[-1]
    if x=="END:VCARD":
        f=file(fn,'wb')
        f.write(vc)
        vc=""
        c+=1
        f.close()
Personal tools