Created
August 14, 2011 18:54
-
-
Save semihozkoroglu/1145172 to your computer and use it in GitHub Desktop.
to vcard
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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