Skip to content

Instantly share code, notes, and snippets.

@yne
Last active July 6, 2019 21:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yne/ecb097b42af22fb844b904ebe17ea942 to your computer and use it in GitHub Desktop.
Save yne/ecb097b42af22fb844b904ebe17ea942 to your computer and use it in GitHub Desktop.
Convert csv from outlook exported contact to android compliant vcard file
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