Hello Jan!

On Sun, 05 Dec 1999, Jan Ulrich Hasecke wrote:

> I am looking for a skript, which converts pines addressbook to mutts
> alias-file. Do you have a hint?

-----------------------> cut here <------------------------ -
#!/usr/bin/perl

# convert the pine address book to mutt (for the query command).
# First argument (if present) must be a valid reg ex.

open( ADDR, "/usr/home/root/.addressbook" ) or die;
if( $#ARGV >= 0 ) {
        $match = $ARGV[0];
} else {
        $match = ".*";
}

print "Pine's address book, regex=$match\n";

while( <ADDR> ) {
        chomp;
        next if /^ /;           # comment lines
        next if /^#DEL/;        # deleted line
        while( /=\?(.*)\?=/ ) {
                $a = $1;
                $a =~ s/^ISO[^?]*\?.\?//;
                $a =~ s/_/ /;
                $a =~ s/=(..)/chr(hex($1))/ge;
                s/=\?.*\?=/$a/;
        }
        next unless /$match/oi;
        @line = split( /\t/ );
        print "$line[2]\t$line[1]\t$line[0]\n";
}

-----------------------> cut here <------------------------ -

bye - Wilhelm

-- 
>>>>>>>>> Wilhelm Wienemann, Amselweg 10, D-47546 Kalkar/Germany <<<<<<<<<
==========>>>>>   E-Mail: [EMAIL PROTECTED]  <<<<<===========
"And since you are the future keepers of everything, including music, we
 hope you will keep it well, with love, and in joy." (Frederick Fennell)   

Reply via email to