Ottawa PC Users' Group (OPCUG)
 
   Home
   Reviews

 

   Copyright and Usage

   Privacy Policy

   Contact Us

 

Managing Smartphone Contacts

by Alan German

In a previous article (Managing Email Addresses) I looked at how to synchronize contacts in the Thunderbird Email client across multiple devices and users. A similar situation occurs for the contacts on my smartphone, and those on my wife's phone, since we find it useful to have the same list of contacts available on both devices. However, the process that was previously described needs to be tweaked a little since Android smartphones do not export/import the list of contacts as a comma-separated (CSV) file.

In fact, Android exports (and imports) contact information as a Virtual Contact File (VCF). Each contact has its own set of parameters in the form of a virtual business card or vCard. The resulting VCF file is pure ASCII (see Figure 1) and could be imported directly into Microsoft Excel. However, because of the nature of the record format (and the possible use of many more data fields than those shown), the data would require extensive manipulation


 Figure 1.  Sample vCard

However, there is a much simpler solution - use VCF Import v3.085.xlsm, an Excel spreadsheet developed by Greg Hadlock. As Greg notes: "This is an Excel based VBA script used to import bulk .VCF files that contain more than 1 Vcard and then convert them to a comma separated .CSV file or Excel xls file".

Since the spreadsheet uses a VBA macro, Excel must be configured to allow macros to run using Options – Trust Center – Trust Center Settings –Macro Settings – Enable all macros (not recommended; potentially dangerous code can run). As Excel notes, allowing all macros to run should only be enabled if the user knows what they are doing. But, we want to convert our VCF file as easily as possible, and we will be fearless in doing so!

Running the macro is easy. We simply load the Excel spreadsheet which automatically runs the macro and asks us to browse to the subject VCF file. Next, the macro asks if we wish to delete empty columns, but suggests that the answer should be no if we wish to combine multiple VCF files. The reason for this caveat is that different CSV files might contain different data fields and so retaining all the data fields would be advisable.

In my case, there is a limited number of fields in use in the contacts on the two smartphones. It is quite likely that all of the fields will be consistent across both sets of contacts; however, if this proves not to be the case, any additional columns in one of the resulting Excel files will be readily apparent and easily accommodated.


 Figure 2.  Data fields produced by the Excel macro

 Data processing is almost instantaneous and a message box indicates the number of contacts processed and the time taken. The macro parses the data, for example producing First Name (Jim) and Last Name (Watson) from the full name that was entered into the smartphone's list of contacts.

Some additional fields are produced, such as Mobile Phone, since most of the contact information (not shown here) includes this data element. An interesting data field is Middle Name. In my case, this occurs solely due to one contact that takes the form of "Elizabeth and Philip". While it appears that the macro, not unreasonably, identifies "and" as the contact's middle name, this doesn't occur for a number of similar listings. Nevertheless, as noted, such oddities are easily identified and rectified in the resulting spreadsheet.

Now a similar dataset can be obtained from the second smartphone, after which the process of combining the data files, eliminating duplicates, and tidying up the resulting master file is essentially as described in the previous article on Email addresses. The master file can be saved in comma-delimited (CSV) format, and the final consideration is how to import the data back into the smartphone's Contacts app.

The answer, once again, is to use a piece of free software, namely CSV to vCard (author unspecified). Running this program brings up a dialogue box in which we can browse to the master CSV file that we have created, and specify the name of the VCF file that we wish to create.


 Figure 3.  CVS to vCard dialogue box

There is one minor glitch in the data conversion process. The dialogue box lists the data elements to be transferred by the program. The CSV Field lists one of the parameters as Email Address (the column title imported into Excel) but the corresponding vCard Property is blank (see Figure 3). If the program is run in this state, none of the available contact Email addresses will be included in the resulting VCF file. To rectify this issue, it is necessary to press the Select button adjacent to the Email Address field and choose Email from the resulting drop-down menu. Pressing the Convert button then creates the desired VCF file.

Now it's a simple matter to activate the Contacts app on each smartphone, select all of the current contacts, delete these entries (otherwise many of the contacts will be duplicated) and, finally, import the master set of contacts from the new VCF file.


Bottom Line

Free VCF file to CSV or Excel converter (Freeware)
Greg Hadlock

https://sourceforge.net/projects/bulkvcftocsv/files/

CSV to vCard (Freeware)
http://www.csvtovcard.com



Originally published: February 2020


top of page

 

 

Archived Reviews

A-J

K-Q

R-Z

 

The opinions expressed in these reviews
do not necessarily represent the views of the
Ottawa PC Users' Group or its members.