Take the 2-minute tour ×
Web Applications Stack Exchange is a question and answer site for power users of web applications. It's 100% free, no registration required.

I am currently in the act of cleaning up the contacts on my Gmail account. I have to replace all the numbers with "04" at the beginning to +61 444 444 444 but most of them are in the format such as 0444444444. Instead of manually opening each one and improving the format of each number, is there a quicker and efficient way of doing this? I have roughly around 2000 contacts.

share|improve this question
    
You say Gmail but then you start talking about contacts. Your best bet is to export your contacts, use a powerful text editor to do a global search-and-replace, then re-import your contacts. If that's not what you're after, please edit your question to clarify what it is you're trying to do. –  Al E. Jul 15 '13 at 11:56
    
My contacts that are synced to my gmail address, e.g: All my contacts that are on my phone sync to my gmail account and it also shows up in the "contacts" part of gmail. –  Akash Jul 15 '13 at 12:01
    
I have tried to edit your question to indicate what it is you're actually trying to do. –  Al E. Jul 15 '13 at 12:16
add comment

2 Answers

Export your contacts

  1. Go the Contacts part of Gmail (or go to contacts.google.com
  2. Open the "More" menu
  3. Choose "Export..."
  4. Choose the contacts to export (a particular group or All; you might want to start with a small group at first)
  5. Choose the format to use. Google.csv is probably best to avoid incompatibility issues
  6. Download the file

Edit your contacts

  1. First, make a copy of the file. That way if something gets messed up you can always import the original
  2. Use a text editor to find-and-replace what it is you want to change. I use Notepad++, but you can use just about anything; even notepad.exe is probably fine for this, as long as it doesn't mess up the carriage returns
  3. Save the file

Import your contact data

This will require a leap of faith, because you probably want to delete all of the contacts out of Gmail (or, at least, the ones you downloaded). If you don't, this will still work, but you'll want to merge your duplicates, and you'll end up with contacts that have both the "new" and "old" phone numbers

  1. Check the "select all" checkbox to select all the contacts. If you've only exported and edited a subset, only select them. Delete them.
  2. Open the "More" menu
  3. Choose "Import..."
  4. Import the file you edited

Et voilà!

p.s., Of course, instead you could actually make your contacts do all the work themselves. I've had mixed results.

share|improve this answer
add comment

Just use Google Apps Script to fix the phone numbers:

Assign all to be corrected contacts to a special group.

Run a script like:

function phoneCleanup(){
  var groupToCleanup = ContactsApp.getContactGroup('theGroupName');
  var contactsToCleanup = ContactsApp.getContactsByGroup(groupToCleanup);
  for ( var i=0; i < contactsToCleanup.length; i++) {
    var phoneEntries = contactsToCleanup[i].getPhones();
    for ( var j=0; j < phoneEntries.length; j++) {
      var phoneNumber = phoneEntries[j].getPhoneNumber();
      // reformat the phone number here
      phoneEntries[j].setPhoneNumber(phoneNumber);
    }
  contactsToCleanup[i].removeFromGroup(groupToCleanup);
  }
}

The simplest way to GAS here is to create a new script file in Drive and run the function from script editor.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.