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, 9,971 hits)

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

Share

Comments (36)

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.

toniJuly 6th, 2012 at 3:38 pm

I can not find the solution for the field “Skype” in OS X 10.7.4.

The field in the file “name_file.vcf” is:

IMPP;X-SERVICE-TYPE=Skype;type=HOME;type=pref:skype:MyNameSky

Do you have a solution?

One more question, you can export multiple “URL”?

Thanks and sorry for my GooglEnglish
Toni

[...] VCF to CSV Convertor Another online option CSV to VCF online Convertor Sourceforge Convertor option GNU Code option 1 GNU Code option 2 This entry was posted in Podcast by MyMacPodcast. Bookmark the [...]

AnonymousAugust 17th, 2012 at 10:01 am

Is this a MAC only application? I’m a PC user and need to import 1000+ vcf’s into outlook. This file type is unrecognized by my PC. Instructions to use??? Help!?! Thanks!

adminAugust 18th, 2012 at 6:59 pm

It can definitely work on Windows. All you need is Python (http://www.python.org/getit/windows/).

SatheeshJanuary 3rd, 2013 at 4:17 am

i Have 1340 Contacts in Pc, How Can import that into Outlook,

hassanMay 9th, 2013 at 2:27 pm

I have 2500 contacts on my pc in vcf format but my nokia 6500c cant access them and keeps telling me format not suported help urgently cant use my contacts….hassan

SatyaJune 7th, 2013 at 8:14 pm

Hi Peter,

Thanks for your program.
My vcf file uses VARD 2.1 format, Can you please help to convert this.

With this program, I am getting WARNING in the first column of csv as “Unexpected VCARD version: 2.1.”. And names are not getting listed, but phone numbers are shown.

adminJune 9th, 2013 at 10:04 am

Satya,

I looks like the FN tags is the same for VCARD 2.1 and 3.0. It should work. Can you share a record from your file?

devid martinOctober 4th, 2013 at 3:37 am

You can also use vCard converter: http://www.vcardconverter.in/

Leave a comment

Your comment