Convert GoogleCL gmail contacts to cone adress book

google contacts list name,name,email|perl -pne 's%^((?!N\/A)(.+?)),((?!N\/A)(.+?)),([a-z0-9\._-]+\@([a-z0-9][a-z0-9-]*[a-z0-9]\.)+([a-z]+\.)?([a-z]+))%${1}:${3} <${5}>%imx' #see below for full command
Full Command: google contacts list name,name,email|perl -pne 's%^((?!N\/A)(.+?)),((?!N\/A)(.+?)),([a-z0-9\._-]+\@([a-z0-9][a-z0-9-]*[a-z0-9]\.)+([a-z]+\.)?([a-z]+))%${1}:${3} <${5}>%imx'|grep -oP '^((?!N\/A)(.+?)) <[a-z0-9\._-]+\@([a-z0-9][a-z0-9-]*[a-z0-9]\.)+([a-z]+\.)?([a-z]+)>' | sort You'll need googlecl and python-gdata. First setup google cl via: google Then give your PC access google contacts list name,email Then do the command, save it or use this one to dump it in the cone-address.txt file in your home dir: google contacts list name,name,email | perl -p -n -e 's%^((?!N\/A)(.+?)),((?!N\/A)(.+?)),([a-z0-9\._-]+\@([a-z0-9][a-z0-9-]*[a-z0-9]\.)+([a-z]+\.)?([a-z]+))%${1}:${3} <${5}>%imx' | grep -o -P '^((?!N\/A)(.+?)) <[a-z0-9\._-]+\@([a-z0-9][a-z0-9-]*[a-z0-9]\.)+([a-z]+\.)?([a-z]+)>' | sort > ~/cone-adress.txt Then import into cone. It filters out multiple emails, and contacts with no email that have N/A. (Picasa photo persons without email for example...)
Sample Output
Contact One: Contact2 <[email protected]>
Contact Two: Contact2 <[email protected]>

What Others Think

+1 for GoogleCL. For those who haven't heard of it, GoogleCL allows command-line access to your Google Apps. Very useful.
StefanLasiewski · 537 weeks and 3 days ago
You can also do it with the abook: data=name,email,phone,address,im,company,notes; (echo $data; google contacts list $data) | abook --convert --informat csv --outformat abook --outfile ~/.abook/addressbook
matthewbauer · 537 weeks and 3 days ago
googlecl no more works since google has update is auth service from OAuth1 to OAuth2 :(.
rcspam · 256 weeks and 3 days ago
When the writers are working on Religion and Theology Writing Services, they have to ensure they conduct thorough Religion and Theology Research Writing Services on the topic areas in order to complete the best Custom Religion & Theology Research Paper using recent sources.
florahwilliams · 36 weeks ago
WritePaperFor.Me is the best site here . You’ll provide even the most challenging papers by the deadline .
TomNill · 27 weeks and 2 days ago
There are a multitude of resources available for a wide variety of industries looking to hire freelancers. Field Engineer is a well-known global marketplace, where you can hire engineers and technicians to assist your workforce
kotifield · 22 weeks and 6 days ago
Nice concept, briefly described, and helpful for website content writing help for beginners like me to learn new things and unique content. Good work!
RidaHashmi · 22 weeks ago
I think this site is good to buy tiktok likes
soclikes · 18 weeks and 6 days ago
I think this site is good to buy tiktok likes
soclikes · 18 weeks and 6 days ago
its a good information, thanks for sharing. ">[pii_email_11fe1b3b7ddac37a081f]
neerajawtm · 6 weeks ago
its a good information, thanks for sharing. [pii_email_11fe1b3b7ddac37a081f]
neerajawtm · 6 weeks ago
The information mentioned by the forum is very helpful, and I would also like to share some fun infotainment.
navonwolf · 2 weeks and 6 days ago
The article has outstanding image content. All information in the article is very delicate. I will keep waiting for your posts. ">technology “write for us”
saichinni · 1 week and 5 days ago
Thanks for sharing.< a href="">tamilrockers proxy
saichinni · 12 hours ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this? is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands

Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.


Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: