Created
September 4, 2014 12:10
-
-
Save inabhi9/b194d44fcaea2f642354 to your computer and use it in GitHub Desktop.
Split single vCard to multiple vcards
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
#!/usr/bin/python | |
cnt = 0 | |
o = None | |
with open('/tmp/00001.vcf') as f: | |
for l in f.readlines(): | |
if 'BEGIN:VCARD' in l: | |
o = open('/tmp/contacts/%s.vcf' % cnt, 'w') | |
o.write(l) | |
if 'END:VCARD' in l: | |
o.close() | |
cnt += 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment