Import an Outlook CSV file to Address Book

Sep 02, '05 09:03:00AM

Contributed by: Anonymous

I recently had to import an export of my contacts from Outlook on a PC in comma-separated values (CSV) format into Address Book. After looking around for converter/importer programs and finding none (at least, none that I could get to work!), I cobbled together the following from various hints and advice. I offer it here for anyone trying to bring data across from Wintel to Mac. There are undoubtedly other ways solutions, but this way doesn't involve writing or modifying any code.

You will need Mozilla and Excel (or some other spreadsheet program that can open and save in CSV format). An overview is as follows:

  1. Get Mozilla or Netscape (not Firefox; you need the Mozilla suite).
  2. Using Mozilla's Address Book, create a dummy record and export as text file.
  3. Open said export in Excel and match the column order of your CSV file to that of the export.
  4. Import your rearranged CSV file into Mozilla address book.
  5. Export the just imported addresses as an LDIF file.
  6. Import the LDIF file to Address Book.
Read on for a detailed walkthrough...

  1. Get Mozilla/Netscape:
    Download from www.mozilla.org. I used Mozilla 1.7.11.

  2. Mozilla Address Book:
    Go to Mozilla's Address Book (in the Window menu item or Command-5). It will be empty. Create a new record card and place something in each of the fields. I found it helpful to replicate each field name in the field itself -- i.e. in the "Email:" field, enter "email1@email.com.au," "Workphone" in the work phone number field, etc. This helps later when you have to get the columns in your CSV file in the right order.

  3. Export CSV file from Mozilla Address Book:
    In the Tools menu item, there is an Export command. Export the Address Book with your dummy record as a CSV file (so you can open it in Excel).

  4. Rearrange your original CSV file:
    Open both the exported Mozilla Address Book file and your Contacts CSV file with your contacts in Excel (it would be advisable to use a copy of your Contacts CSV file, in case something goes wrong!). This part is a bit labourious, but you simply get your Contacts CSV file in the same column order as the Mozilla Address Book file with the dummy record. You can manually cut-and-paste the columns, or use Excel functions to move the data across into the correct column order.

    A better way to do this is to insert into your Contacts CSV file as many columns as there are fields in the exported Mozilla Address Book file to the left of your Contact data, and then use functions to copy information from the original columns to the newly inserted columns. These new columns can then be pasted into a blank Excel file and saved.

    Some of the fields won't match exactly - for example, Mozilla only has two "Street" fields for an address, whereas Outlook has three. In this case, you can use the concatenate function to combine the second and third "Street" fields in the rearranged column order. For example, =if(Street3Cell = "", Street2Cell, Street2Cell & " " & Street3Cell). Unfortunately, you will need to check this yourself.

    I also found it good to use an "if" function to avoid copying a "0" value into a column that is blank in the original file. For example, you can input =if(Cell1 = "","",Cell1), which will copy the value if it isn't empty.

  5. Import your rearranged CSV file into Mozilla address book:
    Save the rearranged Contacts CSV file as a new CSV-format file. Go back to Mozilla's Address Book and import the file (in the wizard, import "Address Books" as a text file).

  6. Export the just imported addresses as an LDIF file:
    Select the newly imported address book and export it from Mozilla, this time as an LDIF file.

  7. Import the LDIF file to Address Book:
    Go to OS X's Address Book and import the LDIF file (File: Import) and you are done.
Hope this is helpful.

Comments (14)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20050828200319417