Exporting addresses from Evolution

I have some contact details stored in Evolution but recently needed to provide some of them in CSV format. After a bit of searching I discovered there is a command called addressbook-export that can be used to do this. On Fedora I found the command in directory /usr/libexec/evolution-data-server but it might be different for other distributions.

The first thing to do is to list out the address books using

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

This will produce a line per address book with comma-separated values. The second value is the name of the address book (as shown in Evolution) but the next command will need the first value. The next command will export the addresses from the address book z.y@z:

/usr/libexec/evolution-data-server/addressbook-export --format=csv x.y@z

There is an additional option --output to specify the file to which the data should be exported; the default is standard output.

One small issue for me was that I would have liked to have filtered my output by department but this field was not in the output.