Re: [Evolution] Combining Contact Lists

2022-08-10 Thread Matthias Kuntze
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 
Antwort an: jonr...@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?



smime.p7s
Description: S/MIME cryptographic signature
___
evolution-list mailing list
evolution-list@gnome.org
To change your list options or unsubscribe, visit ...
https://mail.gnome.org/mailman/listinfo/evolution-list


Re: [Evolution] Combining Contact Lists

2022-08-10 Thread George Reeke
On Tue, 2022-08-09 at 22:20 -0700, Jonathan Ryshpan wrote:
> Caution: External email
> On Tue, 2022-08-09 at 16:31 +0200, Andre Klapper via evolution-list
> wrote:
> > On Tue, 2022-08-09 at 07:15 -0700, Jonathan Ryshpan wrote:
> > > I have two contact lists, which are very similar but not quite
> > > the
> > > same. What's the best way to combine them?
> > 
Just a comment:  Looks to me like a frequent problem programmers
have with different versions of code.  Only answer is a human has
to look at it--when there is a difference, which version to keep
is a question a program cannot answer.  So I would look at tools
that put the files to be merged in adjacent screens with
differences highlighted.  Oh, these are not text files?  Maybe
you need to script something up to do this then, or reformat
them for the standard tools.
George Reeke


___
evolution-list mailing list
evolution-list@gnome.org
To change your list options or unsubscribe, visit ...
https://mail.gnome.org/mailman/listinfo/evolution-list


Re: [Evolution] Combining Contact Lists

2022-08-10 Thread Andre Klapper via evolution-list
On Wed, 2022-08-10 at 09:21 +0200, Jaroslaw Rafa wrote:
> Dnia 10.08.2022 o godz. 09:15:39 Andre Klapper via evolution-list
> pisze:
> >
> > I hope not. CSV is one of the most broken and error-prone formats out
> > there (no proper character encoding info, etc) if you don't know ASCII-
> > named people only. If at all I'd go for JSON or such. CSV must die.
>
> Isn't pretty much everything UTF-8 nowadays?

Isn't everything that's not "pretty much everything" kind of failing
then, especially if not every software was written "nowadays"? :)

(Furthermore, CSV is a flow of random interpretable bytes with some
commas inbetween, with no other structure at all. Stuff like VCard/VCF
for contacts would be way more suitable.)

andre
--
Andre Klapper  |  ak...@gmx.net
https://blogs.gnome.org/aklapper/

___
evolution-list mailing list
evolution-list@gnome.org
To change your list options or unsubscribe, visit ...
https://mail.gnome.org/mailman/listinfo/evolution-list


Re: [Evolution] Combining Contact Lists

2022-08-10 Thread Milan Crha via evolution-list
On Wed, 2022-08-10 at 09:00 +0200, Jaroslaw Rafa wrote:
> I would export both lists to CSV

Hi,
it's possible to right-click any item in an address book (a simple
contact or a contact list) and choose Save as vCard. There is also

   /usr/libexec/evolution-data-server/addressbook-export

which has some options (use --help).

The CSV is bad, also because it has limited list of things it can
contain. The vCard (which is used internally by the evolution-data-
server) is more feature-rich. Exporting to CSV can lead to data loss.

Evolution itself also does contact merging, in some degree. When trying
to save a similar entry in the address book, the user is asked whether
merge it with an existing item or add it. How precisely it's determined
whether the to-be-saved item needs to do the merging dialog I do not
recall.

A related bug report:
https://gitlab.gnome.org/GNOME/evolution/-/issues/1625

Bye,
Milan

___
evolution-list mailing list
evolution-list@gnome.org
To change your list options or unsubscribe, visit ...
https://mail.gnome.org/mailman/listinfo/evolution-list


Re: [Evolution] Combining Contact Lists

2022-08-10 Thread Jaroslaw Rafa
Dnia 10.08.2022 o godz. 09:15:39 Andre Klapper via evolution-list pisze:
> 
> I hope not. CSV is one of the most broken and error-prone formats out
> there (no proper character encoding info, etc) if you don't know ASCII-
> named people only. If at all I'd go for JSON or such. CSV must die.

Isn't pretty much everything UTF-8 nowadays?
-- 
Regards,
   Jaroslaw Rafa
   r...@rafa.eu.org
--
"In a million years, when kids go to school, they're gonna know: once there
was a Hushpuppy, and she lived with her daddy in the Bathtub."
___
evolution-list mailing list
evolution-list@gnome.org
To change your list options or unsubscribe, visit ...
https://mail.gnome.org/mailman/listinfo/evolution-list


Re: [Evolution] Combining Contact Lists

2022-08-10 Thread Andre Klapper via evolution-list
On Wed, 2022-08-10 at 09:00 +0200, Jaroslaw Rafa wrote:
> but is there an option of
> exporting/importing the contact list to/from CSV format?
>
> If yes, I would export both lists to CSV, merge them using "meld" or a
> similar program and import the merged list back.

I hope not. CSV is one of the most broken and error-prone formats out
there (no proper character encoding info, etc) if you don't know ASCII-
named people only. If at all I'd go for JSON or such. CSV must die.

andre
--
Andre Klapper  |  ak...@gmx.net
https://blogs.gnome.org/aklapper/

___
evolution-list mailing list
evolution-list@gnome.org
To change your list options or unsubscribe, visit ...
https://mail.gnome.org/mailman/listinfo/evolution-list


Re: [Evolution] Combining Contact Lists

2022-08-10 Thread Jaroslaw Rafa
Dnia  9.08.2022 o godz. 22:20:24 Jonathan Ryshpan pisze:
> A very good question. For a long time I had a unified list of contacts,
> maintained by Google, which was available both to my cell phone and to
> evolution. Then Google changed its login procedure so that evolution was
> no longer able to access Google's list, and changes made to evolution's
> list were no longer reflected on Google's list, and vice versa. Now
> (thanks to some help from Milan C.) Google's list is available to
> evolution, which sees it as a new list. 
> 
> So the question is how to create a list (possibly an existing one) that
> incorporates the entries made in evolution's and Google's lists.

I never had the need to use contact list in any email client app (I either
just know the addresses of people I'm corresponding with and enter them
manually, or I reply to emails that I received so I don't have to enter any
addresses), so I'm just speculating - but is there an option of
exporting/importing the contact list to/from CSV format?

If yes, I would export both lists to CSV, merge them using "meld" or a
similar program and import the merged list back.
-- 
Regards,
   Jaroslaw Rafa
   r...@rafa.eu.org
--
"In a million years, when kids go to school, they're gonna know: once there
was a Hushpuppy, and she lived with her daddy in the Bathtub."
___
evolution-list mailing list
evolution-list@gnome.org
To change your list options or unsubscribe, visit ...
https://mail.gnome.org/mailman/listinfo/evolution-list


Re: [Evolution] Combining Contact Lists

2022-08-09 Thread Patrick O'Callaghan
On Tue, 2022-08-09 at 22:20 -0700, Jonathan Ryshpan wrote:
> On Tue, 2022-08-09 at 16:31 +0200, Andre Klapper via evolution-list
> wrote:
> > On Tue, 2022-08-09 at 07:15 -0700, Jonathan Ryshpan wrote:
> > > I have two contact lists, which are very similar but not quite
> > > the
> > > same. What's the best way to combine them?
> > 
> > Please see https://xyproblem.info/ . Which problem would that
> > solve?
> 
> A very good question. For a long time I had a unified list of
> contacts,
> maintained by Google, which was available both to my cell phone and
> to
> evolution. Then Google changed its login procedure so that evolution
> was
> no longer able to access Google's list, and changes made to
> evolution's
> list were no longer reflected on Google's list, and vice versa. Now
> (thanks to some help from Milan C.) Google's list is available to
> evolution, which sees it as a new list. 
> 
> So the question is how to create a list (possibly an existing one)
> that
> incorporates the entries made in evolution's and Google's lists.

Google's Contacts app has a de-duplication function. That might be the
easiest solution.

poc
___
evolution-list mailing list
evolution-list@gnome.org
To change your list options or unsubscribe, visit ...
https://mail.gnome.org/mailman/listinfo/evolution-list


Re: [Evolution] Combining Contact Lists

2022-08-09 Thread Jonathan Ryshpan
On Tue, 2022-08-09 at 16:31 +0200, Andre Klapper via evolution-list
wrote:
> On Tue, 2022-08-09 at 07:15 -0700, Jonathan Ryshpan wrote:
> > I have two contact lists, which are very similar but not quite the
> > same. What's the best way to combine them?
> 
> Please see https://xyproblem.info/ . Which problem would that solve?

A very good question. For a long time I had a unified list of contacts,
maintained by Google, which was available both to my cell phone and to
evolution. Then Google changed its login procedure so that evolution was
no longer able to access Google's list, and changes made to evolution's
list were no longer reflected on Google's list, and vice versa. Now
(thanks to some help from Milan C.) Google's list is available to
evolution, which sees it as a new list. 

So the question is how to create a list (possibly an existing one) that
incorporates the entries made in evolution's and Google's lists.
-- 
Sincerely Jonathan Ryshpan 

 Rich or poor, it's good to have money.
___
evolution-list mailing list
evolution-list@gnome.org
To change your list options or unsubscribe, visit ...
https://mail.gnome.org/mailman/listinfo/evolution-list


Re: [Evolution] Combining Contact Lists

2022-08-09 Thread Andre Klapper via evolution-list
Hi,

On Tue, 2022-08-09 at 07:15 -0700, Jonathan Ryshpan wrote:
> I have two contact lists, which are very similar but not quite the
> same. What's the best way to combine them?

Please see https://xyproblem.info/ . Which problem would that solve?

Thanks,
andre
--
Andre Klapper  |  ak...@gmx.net
https://blogs.gnome.org/aklapper/

___
evolution-list mailing list
evolution-list@gnome.org
To change your list options or unsubscribe, visit ...
https://mail.gnome.org/mailman/listinfo/evolution-list


[Evolution] Combining Contact Lists

2022-08-09 Thread Jonathan Ryshpan
I have two contact lists, which are very similar but not quite the same.
What's the best way to combine them?

-- 
Sincerely Jonathan Ryshpan 

 We've heard that a million monkeys at a million keyboards
 could produce the Complete Works of Shakespeare; 
 now, thanks to the Internet, we know this is not true.
 --Robert Wilensky, University of California
___
evolution-list mailing list
evolution-list@gnome.org
To change your list options or unsubscribe, visit ...
https://mail.gnome.org/mailman/listinfo/evolution-list