vcard2csv icon indicating copy to clipboard operation
vcard2csv copied to clipboard

Error missing type

Open LatinSuD opened this issue 3 years ago • 1 comments

I got this dump from iCloud or iPhone (not sure).

  1. Notice that "item3" does not have a "type=".
VERSION:3.0
PRODID:-//Apple Inc.//iOS 13.6//EN
N:Smith;Son;John;;
FN:John Smith Son
NICKNAME:The Boss
ORG:HisPlace;
item1.EMAIL;type=INTERNET;type=pref:[email protected]
item1.X-ABLabel:Trabajo
item2.TEL;type=pref:+3461234567
item2.X-ABLabel:Móvil
item3.TEL:+34912345678
item3.X-ABLabel:Trabajo
REV:2020-08-12T07:29:12Z
END:VCARD

It makes the code crash.

  1. Also note that currently the script ignores "type=pref", which seem to be very common in my dump. Some discussion on this issue here: https://stackoverflow.com/questions/56483409/standards-source-where-vcf-type-pref-is-defined-as-the-preferred-of-a-medium

LatinSuD avatar Feb 14 '22 14:02 LatinSuD

Hi @LatinSuD, thanks for your interest in this script. I believe this is essentially the same issues as https://github.com/nbeaver/vcard2csv/issues/2 although in your case you've provided an anonymized example which is quite helpful.

One thing that makes this a bit tricky is that the type parameter could be just about anything, so the columns of the generated TSV could vary greatly depending on the input files. I'll need to think a bit to decide the best way to go about this in a consistent way, since I intended this script to be used on a particular set of vCards with consistent field values, not on arbitrary heterogeneous collections of vCard files. You may find it more expedient to just adapt the script to your particular collection of vCards rather than waiting for me to write a solution that properly handles the general case.

nbeaver avatar Feb 15 '22 03:02 nbeaver