Thursday, January 28, 2010

How to import Nokia (or any .csv) contacts into Thunderbird 3 on Windows XP

There may be a more elegant way to do this; I'm simply documenting the method that I ultimately found successful, in the hope that someone, somewhere may be saved some time.

I was working with a Nokia 3110c. I have no idea whether that matters, but I would expect that the same method would work for any Nokia that you could connect to the Nokia PC suite.

Software required (you may be able to use other versions of the software, but I don't know):
1) Nokia PC Suite  ver.
2) OpenOffice Calc 3.1.1 (You could equally well use Excel or any program that allows you to look at CSV (comma separated values) files.
3) Thunderbird 3.0.1

Optional: AutoHotKey v. 1.0.48

Part 1: Exporting contacts from Nokia 3110c
  1. Open up Nokia PC Suite and go to the Contacts manager. Follow the on screen instructions to connect your phone with the application. It's fairly straightforward to do so.
  2. Select all the contacts you want to export (Note: I save my contacts to phone. If you have them saved to SIM, you may need to copy them to your phone first.). If you want to export all of them, Ctrl-A works as Select All. If you want to export some of them, use Ctrl-click to select all of the ones you want.
  3. Go to the File menu, and select Export.
  4. Pick a convenient location to save the file. You will need to open it again fairly soon.
  5. Give your file a name (nokiacontacts or some such), making sure that the Save as type: box has Comma Separated Values (*.csv) selected.
  6. Press the green check mark.
  7. Exit Nokia PC Suite
Part 2: Formatting contacts file for import into Thunderbird
  1. Open up Thunderbird.
  2. Click on the Address Book button or simply Ctrl-Shift-B
  3. Go to the Tools menu in the Address Book window and select Export.
  4. Choose a location and filename.
  5. Make sure, once again, that the Save as type: box says Comma Separated. The default on mine is LDIF.
  6. Click on OK.
  7. Boot up Calc/Excel/whatever program you will use to edit your CSV file. (The instructions that follow are specific to Calc. Some of the steps may be different if you are using other software.)
  8. Open the .csv file you created in Part 1 from your Nokia phone contacts.
  9. The Text Import dialog box should open up. The first option you can change is Character Set. Change this from Unicode to Western Europe (Windows-1252/WinLatin 1). I'm not 100% certain you have to do this step, but I think it might be critical.
  10. Check that the Separated by: option has the Comma box checked off.
  11. Press OK.
  12. You should get a spreadsheet with the first column "Title" preceded by some gobbledygook characters. Delete the gobbledygook. Save the file, selecting Keep Current Format.
  13. Also open up the .csv file you exported from Thunderbird. You'll notice that the Character set reads Western Europe (Windows-1252/WinLatin 1). Leave it that way. 
  14. If you compare the two files, you'll notice that the fields are not exactly the same. So go ahead and plan which field from the phone contacts should map to a given field in the Thunderbird addressbook. Depending on how detailed the info is that you keep in your phone, this may take some time. I advise that you actually change the names of the columns in the nokiacontacts.csv to match the Thunderbird fields.
  15. Delete all the columns in nokiacontacts.csv that you won't be mapping to Thunderbird. If you don't have an equivalent field in Thunderbird, you can transfer it to a Custom field. There are 4 available.
  16. THIS STEP IS REALLY IMPORTANT: You may or may not notice that Thunderbird has a First Name field, a Last Name field, and a Display Name field. You HAVE to put something in the Display Name column if you want names to show up when you look at your contacts in Thunderbird. Otherwise, the names will be there, but will not show up unless you open the contact up for editing. You have some options for what to do about the Display Name field. The next few steps are what I chose to do.
  17. Make a copy of the First Name (DupFirstName) and Last Name (DupLastName) columns in the nokiacontacts.csv file.
  18. Select a contact's DupFirst and DupLast names. So if First Name is Mohammed and Last Name is Ahmed, select Mohammed and Ahmed from the DupFirstName and DupLastName columns. Now merge those two cells (Alt-O-E). Calc will ask if the contents should be moved into the first cell. Tell it Yes.
  19. Either go through and do this for each contact or follow OPTIONAL PART 2a.
  20. Save nokiacontacts.csv, making sure to Keep the Current Format.
OPTIONAL PART 2a. Automating the Display Name Merge I have 521 phone contacts. I was not looking forward to repeating Step17 521 times. So I wrote a little AutoHotKey script to do the merging for me. Here's the script. You will need AutoHotKey to make it work.
    1. Open up Notepad or any text editor.
    2. Enter the following script, which simply automates Step 18, telling the software to select the cell to the right, press Alt-O-E, then Alt-Y, then Enter. And repeat this 520 times.
loop, 520
;YOU SHOULD REPLACE the 520 in the above line with the number of contacts you need merged.
{Send +{Right}!oe
SetKeyDelay, 15
Send !y{Enter}
3. Save the text file as merge.ahk
4. Install AutoHotKey. I got it a long time ago and don't have the URL handy, sorry. Might add it later.
5. Double click on the icon for merge.ahk
6. Return to nokiacontacts.csv. Select the first DupFirstName entry. Hit Windows-M and let AutoHotKey complete the merge for you.
IMPORTANT NOTE: This script assumes that you have DupFirstName and DupLastName in adjacent columns. Also, it may be a kludgy script. I've never used AutoHotKey before, and I have no programming experience.
7. Go back to the Part2 instructions.
Part 3: Importing contacts file into Thunderbird
  1. Open up Thunderbird
  2. Press Alt-T-M or go to the Tools menu and select Import.
  3. At the Import dialog box, select Address Books and click on Next.
  4. In Select the Type of File, choose Text File (LDIF, .csv, etc.)
  5. Select your nokiacontacts.csv file. The dialog box will read LDIF at the bottom. You will need to change that to All files or Comma Separated in order to see your .csv file.
  6. You should now see an Import Address Book dialog box. The column on the left shows the Thunderbird Address Book fields, and the column on the right shows the nokiacontacts.csv fields.
  7. You have to move the Thunderbird fields up and down to match the appropriate nokiacontacts.csv fields. TIP: Start by matching up with the first field from nokiacontacts.csv, and work your way down, otheriwise you will have to keep realigning fields. So align First Name with First Name, then Last Name with Last Name, etc. Thunderbird remembers the order you last used, so if you've never imported an addressbook before, and you put your nokiacontacts.csv columns in the same order as the thunderbird.csv file, you may not have much realigning to do. I've messed around with it too much to know for sure.
  8. Make sure you have all the appropriate Address Book fields checked. Every time you click on the field, you toggle the checkbox.
  9. Press OK.
  10. Enjoy the fact that you have now done in 15 minutes what it took me a few hours to figure out.
At some later point, I will try to figure out whether I can actually merge address books. Will update the post then.

Thursday, January 14, 2010

City of contradictions

What happens when you put a PakAmeristanican in Abu Dhabi? Turns out,
not very much, at least for the first six months. Immigration tax, here,
is levied in lost hours and dead trees.

It never occurred to me that every culture has its own special brand of
(il)logic. And it should have, because I really should know that
cultures think differently. Certainly Pakistan and the United States do.
Why I expected that the UAE would fit one or the other mindset, I don't
know. Sheer intellectual laziness on my part, I guess.

Why do I call it a city of contradictions? Well, let's see: the
population of the UAE is something like 3/4 expatriates. But you always
remain, as far as I can tell, a resident alien. There is no possibility
of naturalization, unless you happen to be an expat woman who marries an
Emirati man. Then, of course, like all women naturally do, you give up
any identity you might previously have had, and take on your husband's,
immersing yourself in it entirely. ;)

Every house in Abu Dhabi is connected to a fibre-optic cable network,
but internet access is prohibitively expensive, and even when you get
online, the number of sites that are blocked by the state-owned telecom
company is simply phenomenal. You can't access flickr. You can't access
a lot of blogs. I've only had an internet connection for a month or so,
and I've already seen "This site is blocked" on countless occasions. And
really, my web-browsing activities are rated G, maybe PG-13
occasionally. Also, the only reason I have internet access is because I
went out and purchased a USB broadband modem, allowing me essentially,
to use a cellphone connection to connect. The cable internet connection,
which we applied for on the 14th of July, as the call center person
kindly reminds me every two weeks when I call again to request
follow-up, is STILL not active. Two months ago (four months after we
applied), people finally came and installed a cable modem and wireless
router, so the home network has been working since then, but they told
us that the link wouldn't actually be up for another week. Eight weeks
after that, some men from the telecom company put in the cable, and said
it would be three working days before the connection went live. That was
Saturday, twelve days ago. It still doesn't work.

Oh, and here's the punchline. The hold "music" for Etisalat (the telecom
company) is a series of marketing pitches. Yesterday, this is what I got
to hear: "If you are having trouble configuring your internet
connection, or accessing the internet, you can use Esupport, our
troubleshooting software. Best of all, it's free. For more information,
simply log on to"

My three year old son couldn't figure out why I was laughing like a
madwoman while on hold.