Before doing a diff/meld you should normalize the vcf data e.g. with
the following commands (in an empty directory):
csplit your-address-file.vcf /^END:VCARD/ {*} >/dev/null
for i in xx*; do
name=$(grep "^N:" $i | cut -d\; -f1-2 | sed 's/^N:;*//;s/;/_/')
cat $i |
tr -d '\r' |
sed -Ez 's/(BEGIN|END):VCARD\n//g;s/\n //g' |
sort |
sed -z 's/^/BEGIN:VCARD\n/;s/$/END:VCARD\n/' >"$name.vcf"
rm $i
done
cat *.vcf >$$
rm *.vcf
mv $$ addr.vcf
The addr.vcf file is sorted according to the fields and the address-
entries (field N). You then can do diff/meld and merge as you like.
Matthias
-------- Ursprüngliche Nachricht --------
Von: Jonathan Ryshpan <jonrysh pacbell net>
Antwort an: jonrysh pacbell net
An: evolution-list gnome org
Betreff: [Evolution] Combining Contact Lists
Datum: Tue, 09 Aug 2022 07:15:43 -0700
I have two contact lists, which are very similar but not quite the
same. What's the best way to combine them?
Attachment:
smime.p7s
Description: S/MIME cryptographic signature