VCF to CSV Converter

New version of the converter is ready for testing. It adds support of a large number of fields and conforms to the VCARD 3.0 standard.

You can find it here: http://code.google.com/p/vcf-to-csv-converter/

I will leave this old version here for now, if anyone still needs it.

Param Description
h or –help displays the usage menu
-i filename input file (required parameter)
-o filename output file (require parameter)
-d [comma|tab|semicolon] delimiter to use in the output, tab is default
-q double quote the output values

python ./convertContacts.py -i vcfFile.vcf -o ~/csvFile.csv -d comma -q

  convertContacts.py (5.3 KiB, 5,322 hits)

Latest updates: http://code.google.com/p/vcf-to-csv-converter/

Comments (27)

HessyApril 9th, 2009 at 8:11 pm

awesomo!

hakan yamanMay 1st, 2009 at 1:47 am

Dear Peter,
I will need your help and advice. I’ve been using Sonyericsson phones for long years. I always transferred my vcf phone book directly to my new phones. But now I have a Nokia phone and I cant convert all my phone book to csv. The problem is that in my address book one person some times has 3-4 mobile numbers. When I convert this vcf it only converts some of my numbers not all. What do you think I should do? If you can write to me your advice I would be very happy. Thanks a lot.

adminMay 3rd, 2009 at 10:47 am

Hello Hakan,

Google Contacts allows you to merge multiple contacts into one. You could in theory export to CSV, import the CSV into Google Contacts/GMail and merge the multiples that way.
Your other option is to send me a sample of the input file and perhaps I can find a way to merge multiple similar records into one in some way.

Let me know how it all works out for you.

ChiragJune 21st, 2009 at 7:36 pm

Hi there…can you please help me? I’m not able to convert vCards from Address Book to transfer to a Nokia 8910i phone.. I’ve tried other CSV converters but once I send the file to my phone, it says “not supported by the phone”. Are there different versions of CSV files?
I couldn’t figure out how am I suppose to use the above thing. When I download it, Terminal opens up showing “missing required parameters”
Thank you…

adminJune 23rd, 2009 at 6:00 am

Unfortunately I’m not familiar with the details of the import file required by the 8910i. There’s a possibility they require a different delimiter or something. To use my converter you would type in a command like this:

python ./convertContacts.py -i {input file name} -i {output file name}

Can you tell me how you are executing it?

joni MuellerJune 29th, 2009 at 2:59 pm

Great; saved my bacon when I had over 100 VCF v-cards my boss wanted dumped into excel!! Notice your surname. Srbin? Pozdrav!

Joni

vvJuly 14th, 2009 at 9:59 am

thanks

dragon61August 4th, 2009 at 7:15 am

Hi how to type command python ./convertContacts.py -i {input file name} -i {output file name} ?

the file where i put eg c:\

AlanSeptember 10th, 2009 at 11:59 pm

I couldn’t figure out–it doesn’t do Address/City/State/Zip/Country, or I did something wrong?

billSeptember 20th, 2009 at 3:00 am

tried it with nokia contacts vcf file – no good.

adminSeptember 23rd, 2009 at 2:07 pm

Bill and Alan, if you can send me a file I will try to make it work. Use the contact form please.

MarioSeptember 26th, 2009 at 3:05 am

Hello,

I’m trying to convert contacts from the Motorola RAZR V6 to the LG KP202. This is what happens :

root@marietto2009:/home/marietto/Scrivania/LG# python ./convertContacts.py -i Contacts.vcf -o contacts.csv -d -q
converting Contacts.vcf > contacts.csv (tab delimited)
Traceback (most recent call last):
File “./convertContacts.py”, line 188, in
main()
File “./convertContacts.py”, line 184, in main
VCFToCSVConverter( input_file, output_file, delimiter, quote )
File “./convertContacts.py”, line 139, in __init__
self.__parseFile()
File “./convertContacts.py”, line 45, in __parseFile
self.__parseLine( theLine )
File “./convertContacts.py”, line 63, in __parseLine
self.__processLine( theLine.split(”:”) )
File “./convertContacts.py”, line 71, in __processLine
self.__process_phone( pieces[0].split(”;”)[1], pieces[1] )
IndexError: list index out of range

MarshaMarch 30th, 2010 at 2:24 pm

hello, my name is Marsha, I have 1441 emails in Address book my vcf vcards are all in groups A B C D etc. each group belonging to different places. and I am getting ready to upload them into a bulk mail program. They use a cvs format I can change each of them individually no problem, I need some way to do this quickly, any ideas???
hopefully my casket is finished before I am..
marsha

TanJuly 25th, 2010 at 1:22 pm

File does not exist :( I guess I need to cook my own script

adminJuly 25th, 2010 at 3:48 pm

Oops. Fixed.

adminJuly 25th, 2010 at 3:48 pm

You should probably look at the newer version on google docs, anyways: http://code.google.com/p/vcf-to-csv-converter/

seagolferAugust 24th, 2010 at 5:36 am

I tried to convert about 200 vcf cards from my n900, but I get this error and no output:
Traceback (most recent call last):
File “./convertContacts3.py”, line 467, in
main()
File “./convertContacts3.py”, line 463, in main
VcfToCsvConverter(options.input_file, options.input_path, options.output_file, delimiter, options.quote, options.trace, options.verbose)
File “./convertContacts3.py”, line 413, in __init__
self.__parseFile()
File “./convertContacts3.py”, line 107, in __parseFile
self.__parseLine(theLine)
File “./convertContacts3.py”, line 124, in __parseLine
self.__processLine(theLine.split(”:”))
File “./convertContacts3.py”, line 220, in __processLine
self.__processAddress(pre, pieces[1])
File “./convertContacts3.py”, line 318, in __processAddress
(a,addressTypes) = pre[1].split(”=”);
IndexError: list index out of range

If you need any more info please let me know.

AlyssaSeptember 16th, 2010 at 5:21 pm

Hi,
Will this support a conversion of Palm desktop contacts to Google (for my new Android phone)? I have not found a solution and really hope this is it!

thank you

[...] VCF to CSV Convertor Another online option CSV to VCF online Convertor Sourceforge Convertor option GNU Code option 1 GNU Code option 2 Gaz and Guy on Twitter,feedback@mymac.com, or our Skype direct number [...]

MichaelOctober 9th, 2010 at 10:51 am

I’m trying to convert a Skype vcf contacts file to csv. I’m just trying to pull the Skype display names and phone numbers out. I get the same IndexError: list index out of range as SeaGolfer.

Any suggestions would be appreciated.

Thanks!

adminOctober 11th, 2010 at 11:40 am

As a general note, to process any random field, you should be able to add an “else if” statement to the end of the giant “if…else” statement in __processLine.

elif pre[0] == ‘X-SKYPE-DISPLAYNAME’:
self.__processSingleValue(’ORGANIZATION’, pre, pieces[1])

In this case “X-SKYPE-DISPLAYNAME” is the source field, and “ORGANIZATION” is the destination field.

Some fields that require more logic, such as phone numbers may require a bit more/different logic, such as adding this “else if”

elif pre[0] == ‘X-SKYPE-PSTNNUMBER’:
self.__processTelephone(pre, [pieces[1]])

Peter BriscoeNovember 6th, 2010 at 1:33 am

Hi Peter,
Keen to use your convertor, downloaded it but can you give me some brief details on how to use it.

adminNovember 8th, 2010 at 7:46 am

Make sure you have python installed. Then from the command line, execute something like this:

python ./convertContacts.py -i {vcfFile.vcf} -o {csvFile.csv} -d comma -q

of course replace {vcfFile.vcf} with the path & name of the VCF file and {csvFile.csv} with the path & name of the file you’d like to get.

PJBeeeJanuary 4th, 2011 at 2:15 pm

A glitch in SmarterMail had it importing only ONE record from my GroupWise vcard file, so I needed something to convert the .vcf to .csv.

This seems to have worked perfectly! Had vcard 2.1 file – v3 of your program gave a warning about the version number of the old file, but looks like it converted things fine. The earlier one worked great.

I created a batch file so that I could run from the command line and just feed it the name of the input file, with the same name for the output file (with csv extension of course).

** I renamed the program (convertContacts.py) to just cc2.py **

Here’s the contents of my batch file if anyone is interested – I just put the vcf file into the Python27 folder, and ran my batch from the command prompt in the Python folder in Windows (XP Pro x86):

python ./cc2.py -i %1.vcf -o %1.csv -d comma -q

And then you run it thusly: {batch-file name} {vcf-file name} [Enter]

Other info: used Python 2.7, installed in default folder (c:\python27)

Piece of cake to use.

THANK YOU THANK YOU!

AdminMarch 26th, 2011 at 1:27 pm

Try this Windows version of VCF to CSV Converter from
http://www.softspire.com/vcf-to-csv.html

SandyApril 28th, 2011 at 4:28 am

Can this Script be included in a symbian C++ code? will it work?

T.T. AdomSeptember 7th, 2011 at 2:45 pm

Yes! VCF to CSV conversion over MS Outlook is easy. Go here:

File >> Import & Export > Export a File >> Comma Separated Values (CSV) >> Provide Display Name >> Select Contacts Folder >> and proceed further.

Its not enough, you may also try this vCard converter tool for automate conversion process.

Leave a comment

Your comment