Closed poetaman closed 1 year ago
As described in the docs you will need to have the contacts from your existing database in individual vcard files. One big file with many vcards is not supported.
If our underlying vobject library supports single files with many vcard objects inside an import function should be possible to implement. The import command could accept input in vcard format and normalize them (add a uid e.g.) as well as vaddressbook I would be open for pull requests.
There has been some discussion about this before: #252
https://github.com/jakeogh/vcardtool will split a multiple record vcf into individual files.
It vcardtool encounters VERSION:2.1 records (which cause the warning messages in #279) it suggests preprocessing the input file with https://github.com/jowave/vcard2to3.
vcardtool will also insert a UID field if necessary to address issue #288.
As I was setting up khard
for managing my email client contacts, I also faced the issue of splitting my vcf files, but before I could find this issue, I had written a python script to do it (vcf-splitter for the record).
My point is: shouldn't the docs be updated to mention some scripts for splitting existing vcf files? I can create a PR with a modified version of i.e. doc/source/scripting.rst
referencing the tools mentioned in this issue.
@rogarb PR welcome!
@poetaman I will close this as #317 is merged.
If someone still needs a new subcommand in khard they can use vobject.readComponents
and send a PR.
Can you please add steps needed to import contacts from existing databases? Am looking forward to import contacts from macOS in-built Contacts app. I can select all contacts, and export them as one "vcards" file. Not sure how to import it using Khard. I mean there should be an option to say
khard --import <filename or directory_name>