Skip to content

Instantly share code, notes, and snippets.

@yne yne/csv2vcf.js
Last active Jul 6, 2019

Embed
What would you like to do?
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
You can’t perform that action at this time.