Skip to content

Instantly share code, notes, and snippets.

@sandro010
Created June 6, 2024 17:34
Show Gist options
  • Select an option

  • Save sandro010/82fbae9cc8a8d729a1f042e7ea21b725 to your computer and use it in GitHub Desktop.

Select an option

Save sandro010/82fbae9cc8a8d729a1f042e7ea21b725 to your computer and use it in GitHub Desktop.
VCF generator
import sys
def create_vcf_file(input_file, output_file):
with open(input_file, 'r') as numbers_file:
with open(output_file, 'w') as vcf_file:
for line in numbers_file:
phone_number = line.strip()
vcf_file.write(f"BEGIN:VCARD\nVERSION:3.0\nFN:\nN:;;;;\nTEL;TYPE=CELL:{phone_number}\nCATEGORIES:myContacts\nEND:VCARD\n")
create_vcf_file(sys.argv[1], sys.argv[2])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment