Exporting Contacts from Parsons Addressbook 6.0: A Lesson In Data Parsing

My Dad has been using the same address book software since he first got a computer, since around 1998. Every new computer he buys must be able to run this ancient software that is no longer supported the company that made it.


For Christmas this year, I decided to help him export the contacts to a new platform: Google Contacts.


Game Plan

1. Export the data from Parsons Addressbook 6.0

2. Format the data into a csv file that has the same column headers that the new contact program understands

3. Import the data to the new contact program.


Step 1: Exporting

Parsons Addressbook has an export feature, accessible by going to File > Export/Import and then selecting to export the data. The software will give you a few options for the format in which your data will be exported.


The easiest way to export will be as a csv file and for most people this will work fine. It is important to note that the csv option will only export the first line of the notes. For someone like my Dad, who has been writing notes about his four thousand contacts for over twenty years, this wasn't going to work.


The mmf option (mail merge file) will export all of the notes. Unfortunately, the mmf file requires a lot more conversions than other formats.


About the MMF format

Once you download the file in MMF format, you can open it up with a text editor like notepad. You will see that each line of the file contains data that looks like the following:


"First_Name","Middle_Initial","Last_Name","Title","Job_Title","Organization","Primary_Address","Address_2","City","State_or_Prov","Postal_Code","Country","Work_Phone","Work_Ext","Home_Phone","Home_Ext","Fax","Home_Fax","CustField1","CustField2","CustField3","Exp_Note","Sec_Addr_1","Sec_Addr_2","Second_City","Second_State","Sec_Postal_Code","Sec_Country","Second_Phone","Second_Ext","CustPhon1","CustExt1","CustPhon2","CustExt2","E_Mail","E_Mail2","Pager","Cellular_Phone","Internet_Home_Page","Spouse_Title","Spouse_First_Name","Spouse_Middle_Initial","Spouse_Last_Name","Spouse_Phone","Spouse_Ext","Child_1","Child_2","Child_3","Child_4","Child_5","Child_6","Birthday","Spouse_Birthday","Anniversary","Event_1_No_Date","Event_2_No_Date","Event_1_Date","Event_2_Date","Spouse_Organization","Spouse_Job_Title","Spouse_Fax","Child_1_Birth","Child_2_Birth","Child_3_Birth","Child_4_Birth","Child_5_Birth","Child_6_Birth","Last Modified Date"

This file is essentially a table, where each line is a new row and each piece of data surrounded by quotes and separated by a comma is a new column.


It is important to note that the rows of data are separated by a "\n" character. Any new lines that you may have entered into the address book manually (for example, in the Notes field) are represented by "\r\r". Although these two different newline characters will show up the same when you look at the mmf file in a notepad, you can use this to easily parse the data.


Step 2: Parsing the Data

I used Python to format the data, but you can use whatever language you want. I realize that my way of parsing the data is probably incredibly inefficient, but I was on a deadline over the Christmas holiday and my dad said he'd pay me $20 to get it done so I wasn't in the mood to do too much thinking.


Format the data into a table

To separate the rows, I used a split function to split the file wherever a new line character was used.

imported_mmf.split("\n")

I then split every single line wherever there was a double quote-comma-double quote sequence. In Python, I also had to use the backslash escape character, since the quotes are actually double quotes. It looked like this:

mmf_line.split("\",\"")

I needed to do a bit more cleaning the data, since this would leave the first double quote in mmf_line[0] and the last double quote in mmf_line[len(mmf_line)]. Again, there's probably a better way of doing this but this is the way I decided to do it.

mmf_line[0] = mmf_line[0][1:len(mmf_line[0])]

Repeat this for the last column of data.


Last, but very importantly, is replacing the double new lines in the Notes field with single new lines. Because the program exports "\r\r" for every new line in the Notes field, the new contact manager will read this as two new lines for every new line. My dad didn't like this, and because I'm a good kid I fixed it for him. In the column I determined to be the Notes column, I used a replacement function.

mmf_line[21] = mmf_line[21].replace("\r\r","\r")

Google Contacts reads \r and \n as the same thing, but there's probably some historic reason why the Addressbook program exports two \r characters when it only needs one new line.


Re-label all the columns in accordance with the new formatting style

I had already decided to use Google Contacts as my dad's new contact manager. I created a fake contact in Google Contacts using as many fields as I could. I made sure this fake contact had information in every field my dad would want to use.


I exported the contact as a "Google CSV" and took a look at the headers that Google assigned the fields. I then took a look at the headers from the old mmf file and matched them up. I did this in a round-about way I'm embarrassed to share so I hope you'll do this better than I did.

mmf_line[5] = new_contact_line[4]

I used a for loop to repeat this for every contact (duh) but I also used some for loops to go through a lot of similar fields and just iterate (child_1, child_2, for example).


Step 3: Import contacts to Google Contacts

Save all your work as a csv and then use the import feature in the sidebar in Google Contacts. Take a look at your contacts and make sure that all the information you expect is where you expect.


Google Contacts Troubleshooting and Lessons Learned


Group Membership: what works

The "Group Membership" column should probably contain "* myContacts" in order to include all your contacts in the My Contacts group. You can add more labels to a contact by adding " ::: newGroup". The star character is only to designate Google's own groups like "* myContacts" and " * starred". Any example might look like:

* myContacts ::: * starred ::: College Friends ::: Co-workers

This person's contact will be part of My Contacts, it will be starred, and it will show up under two labels in the sidebar: College Friends and Co-workers.


Group Membership: what doesn't work

Addressbook has a feature that allows you to put contacts on lists or groups. It would be very nice if Addressbook allowed you to export this information, and then you can just add the corresponding Addressbook group into the "Group Membership" field. Unfortunately, Addressbook doesn't provide any easy way to export what group a contact is a part of.


I got around this with some manual labor. I first exported all contacts, then I went through to each group and exported (in the same way) only the contacts that were a member of each group and saved each exported file with the name of the group in a special folder.


I looped through each group mmf file in my script and created a list of all the people in each group. Then, when I was looping through each contact in my main script, I was able to quickly check if that person's name appeared in any of the Addressbook groups and if so, I could add a label like above with that group's name.


All my contacts' info has been put into the "Notes" field?

It is important to know that if the Google Contacts import trips up on just one of your columns, it will put everything besides the "Name" into the Notes field. So if you find that all of your contacts' information is being inputted into the Notes field in Google Contacts, start by commenting out (or deleting) different columns from your data and importing the smaller chunks to try to isolate which columns are causing the problem.


For me, the events field was causing a problem and I never bothered to figure out why. Instead I used the "Birthday" field for the contact's birthday and for child's birthdays I just appended the birthday in text after the Child's name in the "Relation" field.


What if I don't know Python and I want to do this the easiest way possible?

Not tech savvy? No worries! If you don't care about every line of the Notes field being imported into your new contacts program, you can use the much easier CSV export option.


1. Export your CSV file from Parson's Addressbook and open the file in Excel.

2. Create a fake contact in your new contacts manager (make sure to put info into every field you would like to import data into). Export that fake contact as a CSV and open up the file in Excel.

3. Compare the two files. Change all the column headers in the Addressbook exported CSV so that they match the headers that the new contacts manager uses.

4. Try importing your edited Addressbook CSV with all your contacts into your new contact manager and troubleshoot as necessary. If your new contacts manager is Google Contacts, you can take a look at my troubleshooting notes above.