Skip to content

Instantly share code, notes, and snippets.

@semihozkoroglu
Created August 14, 2011 18:54
Show Gist options
  • Select an option

  • Save semihozkoroglu/1145172 to your computer and use it in GitHub Desktop.

Select an option

Save semihozkoroglu/1145172 to your computer and use it in GitHub Desktop.
to vcard
#!/usr/bin/python
# -*- coding: utf-8 -*-
import xlrd
sayf1 = xlrd.open_workbook("Rehber.xls")
sh = sayf1.sheet_by_index(0)
for i in range(sh.nrows):
kisi = sh.cell(i,1).value
numara = sh.cell(i,13).value
numara = str(numara).strip('.0')
content = "BEGIN:VCARD\nVERSION:2.1\nN:"+ kisi + ";\nFN:" + kisi +"\nTEL;CELL;VOICE:" + numara + "\nX-CLASS:PUBLIC\nX-NO:0\nEND:VCARD\n"
gecici = open(kisi + ".vcf","w")
gecici.write(content.encode("utf-8")) #unicode kullanılmaz cunku donusturme islemi yapmamaktadır..
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment