jowave / vcard2to3

Convert vcards from version 2.1 to version 3.0
MIT License
186 stars 15 forks source link

Remove/convert the lines X-TIMES_CONTACTED and X-LAST_TIME_CONTACTED #10

Closed olisax closed 3 years ago

olisax commented 3 years ago

Hello! Thanks for you tool, it works really good for converting 2.1 VCARD (exported from Android) to 3.0 VCARD (to be imported in Nextcloud/Owncloud). :smile: After conversion, some of the contacts failed to be imported, and looking carefully at it it was the ones with the lines X-TIMES_CONTACTED and X-LAST_TIME_CONTACTED that failed to be imported in Nextcloud.

I removed quickly all those lines with the GREP command grep -v EXPR sourcefile > outputfile

But I think this could be also a good feature request for future integration in your tool. :wink: Note that I only deleted the lines, I don't know if there is an updated expression compatible with VCARD 3.0 that can be used instead of deletion :smiley:

Regards, Oli

BEGIN:VCARD
VERSION:3.0
X-TIMES_CONTACTED:6
X-LAST_TIME_CONTACTED:1516015267200
N:Parking;Air;;;
FN:Air Parking
TEL;TYPE=pref,cell:027049101
PHOTO;ENCODING=b;TYPE=JPEG:/9j/
jowave commented 3 years ago

Hi,

thanks for your feedback. You can already remove lines from vCards during conversion using the --remove parameter. E.g.:

./vcard2to3.py --remove X-TIMES_CONTACTED input.vcf

The parameter given to --remove is interpreted as a regex pattern.

I did not find standardized types for those custom types. That said vCard 3.0 should still allow X- types, but since they are not standardized they are often useless when switching applications.