Last active
July 6, 2019 21:15
-
-
Save yne/ecb097b42af22fb844b904ebe17ea942 to your computer and use it in GitHub Desktop.
Convert csv from outlook exported contact to android compliant vcard file
This file contains 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
csv.split('\n').slice(1).filter(e=>e).map(l=>l.split(',')).map(a=>['BEGIN:VCARD','VERSION:2.1','N:'+[a[2],a[0],a[1]].join(';'),...a.slice(11,24).map(m=>`TEL;CELL:`+m),...a.slice(8,11).map(m=>'EMAIL;HOME:'+m),'END:VCARD'].filter(l=>!l.endsWith(':')).join('\n')).join('\n\n') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment