Modify vCard file to work with T-Mobile contacts import tool

Lost my phone and picked up a pre-paid T-Mobile Nokia 2720. I had my contacts backed up to mobical.net so needed to import into the new phone. Mobical exports in vCard format and the T-Mobile Contacts app on my.t-mobile.com can import it.

Exported contacts from Mobical into contacts.vcf, imported at T-Mobile contacts only to discover that it imported all the names, but only some of the phone numbers. WTF? After comparing VCF fields of failures and successes, figured out that T-Mobile contact import tool expects the TEL property name to have a sub-type (work, home, etc).

For example..

Mobical.net VCF export:

BEGIN:VCARD
VERSION:2.1
N:Smith;John;;;
FN:John Smith
TEL;CELL:1234567890
END:VCARD

T-Mobile contacts import expects:

BEGIN:VCARD
VERSION:2.1
N:Smith;John;;;
FN:John Smith
TEL;HOME;CELL:1234567890
END:VCARD

Most of my contacts were missing it:

grep "^TEL" contacts.vcf | cut -d: -f1 | sort | uniq -c
     65 TEL;CELL
      3 TEL;FAX
      2 TEL;HOME;FAX
     22 TEL;VOICE
      5 TEL;WORK;VOICE

This is just a temporary phone, so I'm fine to just make all numbers home:

cat contacts.vcf | sed 's/TEL;CELL/TEL;HOME;CELL/;s/TEL;FAX/TEL;HOME;FAX/;s/TEL;VOICE/TEL;HOME;VOICE/' > contacts.tmobile.vcf

Now I import contacts.tmobile.vcf using the T-Mobile Contacts import tool, sync the phone and move on with my day.

1 Comment

Leave a comment

NOTE: Enclose quotes in <blockquote></blockquote>. Enclose code in <pre lang="LANG"></pre> (where LANG is one of these).