Home » Questions » Computers [ Ask a new question ]

How can I use my Gmail contacts within Alpine/pine?

How can I use my Gmail contacts within Alpine/pine?

How can I use my Gmail contacts within Alpine/pine?

Asked by: Guest | Views: 268
Total answers/comments: 1
bert [Entry]

"You can use this short piece of PYTHON code to extract the relevant columns from the Google CSV (use Export.. on Google Contacts Website). It also takes care of the translation from UTF-16 to your ISO locale.

import io
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
import csv

a=io.open(""google.csv"",'r',encoding=""utf-16"")
r=csv.reader(a,quotechar='""')
for b in r:
if b[28] <> """":
print ""\t""+b[0]+""\t""+b[28]

Call it as in:

python google.py >~/.addressbook"