I took Cliff Wells' python script and hacked it up a little so now it is a fair replacement for the broken evolution-address-book-export. I also attached a perl program to reformat the address book into something else. Enjoy. You will need python2 to run the exportcontacts.py script
#!/usr/bin/python2
import bsddb, os, re
home = os.getenv('HOME')
dbname = '%s/evolution/local/Contacts/addressbook.db' % home
db = bsddb.hashopen(dbname, 'r')
for k in db.keys():
for line in db[k].split('\n'):
print line
db.close()
dbname = '%s/evolution/local/Addresses/addressbook.db' % home
db = bsddb.hashopen(dbname, 'r')
for k in db.keys():
for line in db[k].split('\n'):
print line
db.close()
#!/bin/sh
export PATH
PATH=/home/hans/bin:/usr/bin:$PATH
exportcontacts.py | perl -e'
use strict;
my $line;
my $name;
my $tel_work_voice;
my $tel_work_fax;
my $tel_home;
my $tel_pager;
my $tel_cell;
my $tel_voice;
my $email;
while ( $line = <STDIN> ) {
chomp ($line);
chop ($line) ; # trailing ^M
#BEGIN:VCARD
if ( $line eq "BEGIN:VCARD" ) {
$name = "";
$tel_work_voice = "";
$tel_work_fax = "";
$tel_home = "";
$tel_pager = "";
$tel_cell = "";
$tel_voice = "";
$email = "";
}
#X-EVOLUTION-FILE-AS:
if ( $line =~ /^X-EVOLUTION-FILE-AS\:.*/ ) {
$line =~ s/^X-EVOLUTION-FILE-AS://g;
$name = $line;
print $name." ";
}
#TEL;WORK;VOICE;
if ( $line =~ /^TEL;WORK;VOICE:.*/ ) {
$line =~ s/^TEL;WORK;VOICE://g;
$tel_work_voice = $line;
}
#TEL;WORK;FAX;
if ( $line =~ /^TEL;WORK;FAX:.*/ ) {
$line =~ s/^TEL;WORK;FAX://g;
$tel_work_fax = $line;
}
#TEL;HOME;
if ( $line =~ /^TEL;HOME:.*/ ) {
$line =~ s/^TEL;HOME://g;
$tel_home = $line;
}
#TEL;PAGER;
if ( $line =~ /^TEL;PAGER:.*/ ) {
$line =~ s/^TEL;PAGER://g;
$tel_pager = $line;
}
#TEL;CELL;
if ( $line =~ /^TEL;CELL:.*/ ) {
$line =~ s/^TEL;CELL://g;
$tel_cell = $line;
}
#TEL;VOICE;
if ( $line =~ /^TEL;VOICE:.*/ ) {
$line =~ s/^TEL;VOICE://g;
$tel_voice = $line;
}
#EMAIL;INTERNET;
if ( $line =~ /^EMAIL;INTERNET:.*/ ) {
$line =~ s/^EMAIL;INTERNET://g;
$email = $email.$line;
}
#EMAIL;QUOTED-PRINTABLE;INTERNET;
if ( $line =~ /^EMAIL;QUOTED-PRINTABLE;INTERNET:.*/ ) {
$line =~ s/^EMAIL;QUOTED-PRINTABLE;INTERNET://g;
$line =~ s/=0A/ /g; #=0A make it a space
$email = $email.$line;
}
#END:VCARD
if ( $line eq "END:VCARD" ) {
unless ( $tel_work_voice eq "" ) { print "wk=".$tel_work_voice." "; }
unless ( $tel_work_fax eq "" ) { print "fx=".$tel_work_fax." "; }
unless ( $tel_home eq "" ) { print "hm=".$tel_home." "; }
unless ( $tel_pager eq "" ) { print "pg=".$tel_pager." "; }
unless ( $tel_cell eq "" ) { print "cel=".$tel_cell." "; }
unless ( $tel_voice eq "" ) { print "alt=".$tel_voice." "; }
unless ( $email eq "" ) { print $email; }
print "\n";
}
}
' > /home/hans/bin/data/jpilot.txt
exit 0