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 <contact1@domain.org>
Contact Two: Contact2 <contact2@othersite.nl>

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. http://code.google.com/p/googlecl/
StefanLasiewski · 570 weeks and 2 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 · 570 weeks and 2 days ago
googlecl no more works since google has update is auth service from OAuth1 to OAuth2 :(.
rcspam · 289 weeks and 2 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 · 68 weeks and 6 days ago
WritePaperFor.Me is the best site here . You’ll provide even the most challenging papers by the deadline .
TomNill · 60 weeks and 1 day 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 · 55 weeks and 5 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 · 54 weeks and 6 days ago
I think this site https://soclikes.com/ is good to buy tiktok likes
Danielwilson · 51 weeks and 4 days ago
I think this site https://soclikes.com/ is good to buy tiktok likes
Danielwilson · 51 weeks and 4 days ago
its a good information, thanks for sharing. ">[pii_email_11fe1b3b7ddac37a081f]
neerajawtm · 38 weeks and 6 days ago
its a good information, thanks for sharing. [pii_email_11fe1b3b7ddac37a081f]
neerajawtm · 38 weeks and 6 days ago
The information mentioned by the forum is very helpful, and I would also like to share some fun infotainment. https://iogames.onl https://iogames.onl/skribbl-io-games
navonwolf · 35 weeks and 5 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 · 34 weeks and 3 days ago
Thanks for sharing.< a href="https://www.webtechmantra.com/tamilrockers-proxy/">tamilrockers proxy
saichinni · 32 weeks and 6 days ago
TechUpdatesDaily-A resource where one can find the latest updates & news about technology, software, gadgets and business ideas for the start-ups.
lanarose · 28 weeks and 2 days ago
tech write for us Trendstechblog Our Aim at the availability our readers with more information about the most recent technology news, upcoming gadgets, mobile apps social media, daily changing business strategies, day to day changes in digital marketing.
lanarose · 24 weeks and 6 days ago
You can be popular on tiktok with such video how to fix some technical problems. Read this article https://omegaunderground.com/the-best-way-to-control-your-popularity-and-success-on-social-media/ to know how to get tiktok likes
Danielwilson · 22 weeks and 5 days ago
You can be popular on tiktok with such video how to fix some technical problems. Read this article https://omegaunderground.com/the-best-way-to-control-your-popularity-and-success-on-social-media/ to know how to get tiktok likes
Danielwilson · 22 weeks and 5 days ago
H?w d? ???n-??ur?? ?r?du?t?v?t? ?u?t?? compare t? MS Office - ?nd d??? ?t m?k? ??n?? f?r ??ur ?rg?n?z?t??n t? ?h???? fr?? ??mmun?t? software r?th?r th?n Microsoft's commercially licensed ?ff?r?ng? www.office.com/setup www.office.com/setup
sambattherford · 17 weeks and 5 days ago
H?w d? ???n-??ur?? ?r?du?t?v?t? ?u?t?? compare t? MS Office - ?nd d??? ?t m?k? ??n?? f?r ??ur ?rg?n?z?t??n t? ?h???? fr?? ??mmun?t? software r?th?r th?n Microsoft's commercially licensed ?ff?r?ng? https://w-w-office.com/setup/ https://www.office-help-setup.com
sambattherford · 17 weeks and 5 days ago
H?w d? ???n-??ur?? ?r?du?t?v?t? ?u?t?? compare t? MS Office - ?nd d??? ?t m?k? ??n?? f?r ??ur ?rg?n?z?t??n t? ?h???? fr?? ??mmun?t? software r?th?r th?n Microsoft's commercially licensed ?ff?r?ng? https://w-w-office.com/setup https://www.office-help-setup.com/
sambattherford · 17 weeks and 5 days ago
Hey there! I could have sworn I’ve been to this website before but after checking through some of the posts I realized it’s new to me. https://telegra.ph/How-to-install-Microsoft-office-04-19 https://wordpress.com/post/officewwwofficesetup.home.blog https://telegra.ph/Mcafee-activation-help-04-19 https://officewwwofficesetup.home.blog/ https://officewwwofficecom.wordpress.com/ https://wwwoffice-comsetup.com/ https://www.pearltrees.com/baniblanko https://3prv5m9lgf8f.blog.fc2.com/ https://officecomsetup.odoo.com/ https://office-setup-help.company.site/ https://office-www-office.com/setup/ https://mmcafeeactivate.com/
mikeee · 7 weeks and 5 days ago
Thanks for giving me grateful information. I think this is very important to me. Your post is quite different. That’s why I regularly visit your site. [url=https://hospital-software.dataman.in/]Hospital Software[/url]
shreyamishra · 7 weeks and 3 days ago
Thanks for giving me grateful information. I think this is very important to me. Your post is quite different. That’s why I regularly visit your site. https://hospital-software.dataman.in/
shreyamishra · 7 weeks and 3 days 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?

commandlinefu.com 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.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

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: