Editing Importing Windows Mobile contacts
Warning: You are not logged in.
Your IP address will be recorded in this page's edit history.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 54: | Line 54: | ||
def csvline2vcf(row): | def csvline2vcf(row): | ||
rv="" | rv="" | ||
- | rv | + | rv=rv+"BEGIN:VCARD"+'\n' |
- | rv | + | rv=rv+"VERSION:3.0"+'\n' |
rv=addne(rv, "N:", csvf(row, "Name")) | rv=addne(rv, "N:", csvf(row, "Name")) | ||
rv=addne(rv, "FN:", csvf(row, "First Name")+" "+csvf(row, "Last Name")) | rv=addne(rv, "FN:", csvf(row, "First Name")+" "+csvf(row, "Last Name")) | ||
Line 72: | Line 72: | ||
rv=addne(rv, "BDAY:", convdate(csvf(row, "Birthday"))) | rv=addne(rv, "BDAY:", convdate(csvf(row, "Birthday"))) | ||
rv=addne(rv, "X-ANNIVERSARY:", convdate(csvf(row, "Anniversary"))) | rv=addne(rv, "X-ANNIVERSARY:", convdate(csvf(row, "Anniversary"))) | ||
- | rv | + | rv=rv+"END:VCARD"+'\n'+'\n' |
return rv | return rv | ||
Line 87: | Line 87: | ||
zf=zipfile.ZipFile(sys.argv[1]) | zf=zipfile.ZipFile(sys.argv[1]) | ||
- | contactsFN=[fn for fn in zf.namelist() if 'contacts' | + | contactsFN=[fn for fn in zf.namelist() if (fn.find('contacts')!=-1)][0] |
Line 105: | Line 105: | ||
if lineNo==0: | if lineNo==0: | ||
csv_fields=row | csv_fields=row | ||
- | lineNo | + | lineNo=lineNo+1 |
else: | else: | ||
vcf.write(csvline2vcf(row)) | vcf.write(csvline2vcf(row)) |
Learn more about Contributing to the wiki.