O'Reilly Hacks
oreilly.comO'Reilly NetworkSafari BookshelfConferences Sign In/My Account | View Cart   
Book List Learning Lab PDFs O'Reilly Gear Newsletters Press Room Jobs  

Import Your Contacts into Gmail
Data entry's a drag. Export your contacts from an existing web mail service, desktop email application, or database, and import them into your Gmail address book
[Discuss (0) | Link to this hack]

Possibly the most annoying aspect of moving into any new web mail home is bringing all your family, friends, and business contacts along with you. The average end user has almost been trained not to expect any sort of import utility, instead sighing and settling in for an evening of data entry.

Gmail, as with most post-1990s web mail applications worth their salt, provides the facility for importing all those contacts in just a few clicks; just how many depends on where you're exporting them from. Gmail accepts only one format: comma-separated values (CSV). Thankfully, CSV is about as low a common denominator as you could wish for; Yahoo! Address Book, Outlook, Outlook Express, Mac OS X Address Book (with a little help from a free application), Excel, and many other applications, web or otherwise, speak CSV.


Gmail's Help documentation on the subject of importing contacts is sure to keep up with the needs of its users, so keep an eye on "How do I import addresses into my Contacts list?" (http://gmail.google.com/support/bin/answer.py?answer=8301).

Feed CSV to Gmail

Assuming that you have a CSV file to work with (if you don't, read on to the sections below for some guidance), importing is a snap.

From the main Gmail screen in your web browser, click the Contacts link () found at the bottom of the menu on the left side of the page.

Figure 1. Clicking the Contacts link gets you to your Gmail contacts

The Contacts page opens, listing all of (or none of, if you don't yet have any) your existing Gmail contacts. These may have been entered by hand, gleaned from incoming and outgoing mail, or imported at some earlier date. Click the Import Contacts link link at the top right of the page.

Click the Browse... (or equivalent) button when prompted to do so, as shown in and find your CSV file on your computer's hard drive. (Just what this looks like depends on your operating system and browser, but essentially you're just choosing a file much like you would from any application.) Click the Import Contacts button and—Bob's your uncle (that's "tada!" for my American readers)—you should see a confirmation that all went to plan and you've imported some number of contacts into your Gmail address book.

Figure 2. Finding that CSV file

Click the Return to Contacts link and you'll see your now fully stocked contacts list. shows mine, after importing the second sample CSV at the beginning of this hack.

Figure 3. Feeding that CSV file to Gmail

Delete any number of contacts by clicking their associated checkboxes and clicking the Delete Selected button. Edit a contact by clicking the appropriate [edit] link. Or type in a contact or three by hand using the Add Contact link.

Now, any time you start typing a known contact's name into the To, Cc, or Bcc field of a new message, Gmail will autocomplete it for you. No need to remember that cousin Adam is or Auntie Joan is .

Hopping out of Hotmail

There are a couple ways to hop out of Hotmail with your contacts in tow. The first goes by way of Outlook Express or Outlook and the second using a touch of copy-and-paste, as suggested by the Gmail team in their online Help documentation.

Moving from .Mac

The Mac OS X Address Book only exports to something called vCard, which is understood by many contacts applications, but not by Gmail.

Thankfully, someone's written a magical little app to help. AddressBookToCSV (http://homepage.mac.com/kenferry/software.html#AddressBookToCSV; freeware) slurps up all of your contacts—name and email address only, which is nicer to my mind than uploading a slew of data unnecessary for your Gmailing needs—out of Address Book and spits them into a CSV file that you can feed to Gmail. Download the app, mount the .dmg on your desktop, and run it right from there, as shown in . (If you'll likely use it again and again, go ahead and drag it into your Applications/Utilities folder.)

Figure 13. AddressBookToCSV exports Address Book names and email addresses to CSV

When prompted to do so, choose a place to save the contacts.csv file and click the Save button. Close the application using Command-Q (it doesn't do so by itself when done).

Feed contacts.csv to Gmail as usual.

O'Reilly Home | Privacy Policy

© 2007 O'Reilly Media, Inc.
Website: | Customer Service: | Book issues:

All trademarks and registered trademarks appearing on oreilly.com are the property of their respective owners.