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 1: Line 1:
== Import how to ==
== Import how to ==
-
To import data, we need a backup file created by the approach mentioned in [[Importing data]], the script mentioned in the end of this page and a [[Nokia N900|N900]] (or another Maemo5 device). Power users don't need to follow this precisely, others do:
+
To import data, we need a backup file created by the approach mentioned in [[Importing data]], the script mentioned in the end of this page and a N900 (or another Maemo5 device). Powerusers don't need to follow this precisely, others do:
-
# connect N900 to PC using mass storage mode; from PC, create a directory "datatransfer" on the "flash disk device" - and copy the script (<code>pimbackup2vcf.py</code>) and backup file (e.g. PIMBackup_20091220.pib) to the directory. Unmount and disconnect.
+
# connect N900 to PC using mass storage mode; from PC, create a directory "datatransfer" on the "flash disk device" - and copy the script (pimbackup2vcf.py) and backup file (e.g. PIMBackup_20091220.pib) to the directory. Unmount and disconnect.
# on N900, run xterm
# on N900, run xterm
# <pre>cd /home/user/MyDocs/datatransfer; python pimbackup2vcf.py PIMBackup_20091220.pib contacts.vcf</pre>
# <pre>cd /home/user/MyDocs/datatransfer; python pimbackup2vcf.py PIMBackup_20091220.pib contacts.vcf</pre>
Line 11: Line 11:
== pimbackup2vcf.py ==
== pimbackup2vcf.py ==
-
<source lang="python">
+
<pre>
#!/usr/bin/python2.5
#!/usr/bin/python2.5
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
Line 112: Line 112:
os.remove(TMPFILENAME)
os.remove(TMPFILENAME)
-
</source>
+
</pre>
== Extending the script ==
== Extending the script ==
Line 118: Line 118:
The script would, with little modifications, import contacts data from generally any csv file. The csv file has to contain initial line with columns' titles. Data contained in the output VCF file is defined in the '''csvline2vcf(row)''' function - which converts a csv line to a vcf record string.
The script would, with little modifications, import contacts data from generally any csv file. The csv file has to contain initial line with columns' titles. Data contained in the output VCF file is defined in the '''csvline2vcf(row)''' function - which converts a csv line to a vcf record string.
-
== Updated script with more fields ==
 
-
Definition fields are extended, and include both Home and Work address.
 
-
More Cell Phone numbers created based on limitation of Windows Mobile that has only one Mobile Number field, but some people has more than one Cellphone number, so user usually utilize Radio, Pager, Car Phone as the subsequent mobile numbers.
 
-
 
-
The mapping is arbitrary, adjust to each need/usage.
 
-
 
-
Replace (pay attention to the start and end of the row) above with this code below.
 
-
 
-
<source lang="python">
 
-
def csvline2vcf(row):
 
-
    rv=""
 
-
    rv+="BEGIN:VCARD"+'\n'
 
-
    rv+="VERSION:3.0"+'\n'
 
-
    rv=addne(rv, "N:", csvf(row, "Last Name")+";"+csvf(row, "First Name")+" "+csvf(row, "Middle Name"))
 
-
    rv=addne(rv, "FN:", csvf(row, "Display Name"))
 
-
    rv=addne(rv, "NICKNAME:", csvf(row, "NickName"))
 
-
    rv=addne(rv, "TEL;TYPE=CELL,VOICE:", csvf(row, "Mobile Phone"))
 
-
    rv=addne(rv, "TEL;TYPE=WORK,VOICE:", csvf(row, "Business Phone"))
 
-
    rv=addne(rv, "TEL;TYPE=WORK,VOICE:", csvf(row, "Business Phone 2"))
 
-
    rv=addne(rv, "TEL;TYPE=HOME,VOICE:", csvf(row, "Home Phone"))
 
-
    rv=addne(rv, "TEL;TYPE=HOME,VOICE:", csvf(row, "Home Phone 2"))
 
-
    rv=addne(rv, "TEL;TYPE=WORK,VOICE:", csvf(row, "Work Phone"))
 
-
    rv=addne(rv, "TEL;TYPE=CELL,VOICE:", csvf(row, "Car Phone"))
 
-
    rv=addne(rv, "TEL;TYPE=CELL,VOICE:", csvf(row, "Pager"))
 
-
    rv=addne(rv, "TEL;TYPE=CELL,VOICE:", csvf(row, "Radio Phone"))
 
-
    rv=addne(rv, "TEL;TYPE=CELL,VOICE:", csvf(row, "Assistant's Phone"))
 
-
    rv=addne(rv, "TEL;TYPE=WORK,FAX:", csvf(row, "Business Fax"))
 
-
    rv=addne(rv, "URL:", csvf(row, "Web Page"))
 
-
    rv=addne(rv, "EMAIL;TYPE=PREF,INTERNET:", csvf(row, "E-mail Address"))
 
-
    rv=addne(rv, "EMAIL;TYPE=HOME,INTERNET:", csvf(row, "E-mail 2 Address"))
 
-
    rv=addne(rv, "EMAIL;TYPE=WORK,INTERNET:", csvf(row, "E-mail 3 Address"))
 
-
    rv=addne(rv, "TITLE:", csvf(row, "Job Title"))
 
-
    rv=addne(rv, "ROLE:", csvf(row, "Department"))
 
-
    rv=addne(rv, "ORG:", csvf(row, "Company"))
 
-
    rv=addne(rv, "ADR;TYPE=HOME:", ";"+";"+csvf(row, "Home Street")+';'+csvf(row, "Home City")+';'+csvf(row, "Home State")+';'+csvf(row, "Home Postal Code")+';'+csvf(row, "Home Country"))
 
-
    rv=addne(rv, "ADR;TYPE=WORK:", ";"+";"+csvf(row, "Business Street")+';'+csvf(row, "Business City")+';'+csvf(row, "Business State")+';'+csvf(row, "Business Postal Code")+';'+csvf(row, "Business Country"))
 
-
    rv=addne(rv, "ADR;TYPE=HOME:", ";"+";"+csvf(row, "Other Street")+';'+csvf(row, "Other City")+';'+csvf(row, "Other State")+';'+csvf(row, "Other Postal Code")+';'+csvf(row, "Other Country"))
 
-
    rv=addne(rv, "BDAY:", convdate(csvf(row, "Birthday")))
 
-
    rv=addne(rv, "X-ANNIVERSARY:", convdate(csvf(row, "Anniversary")))
 
-
    rv+="END:VCARD"+'\n'+'\n'
 
-
 
-
    return rv
 
-
</source>
 
-
 
-
== Note ==
 
-
If on the Windows Mobile (WM 6.5.3) the address has a hard return character, the resulting vcf will have broken address field (hard return instead of one row). User might want to review this using text editor first prior to importing.
 
-
   
 
[[Category:Power users]]
[[Category:Power users]]
-
[[Category:HowTo]]
 

Learn more about Contributing to the wiki.


Please note that all contributions to maemo.org wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see maemo.org wiki:Copyrights for details). Do not submit copyrighted work without permission!


Cancel | Editing help (opens in new window)