[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: repost - import a csv file as addressbook for mutt (abook)



On Tue, Nov 12, 2002 at 10:21:43AM +0530, Sandip P Deshmukh wrote:
> hello all!
> 
> i could convert my outlook contact folder information into a csv file.
> it has several fields that are uncommon - spouse's name, etc.
> 
> now, i have started using mutt and will like to use information in the
> same file. either as aliases or through abook.

Mutt aliases are designed to handle email aliases; they're not going to
support things like someones' spouses' name and "Internet Free Busy".
Even abook doesn't support all the fields you posted.  My suggestion
would be to make this your very first perl project.  Start simple,
learning how to load the file into an array of lines, then splitting
each line into a bloody enormous hash (with the field names as keys),
then searching through, then adding new records and deleting old ones.
It wouldn't take more than a couple hundred lines, I'd wager.  My big
hint would be to have a look at the 'split' function (man perlfunc), how
arrays and hashes work (man perldata) and Data::Dumper (man
Data::Dumper).

If you felt extra eager, you could either hack on abook (it's written in
C, AFAICT) to support either the extra fields or arbitrary fields or
write a script to store all the non-abook-compatible stuff as key=value
pairs in the 'notes' field.

If you have any problems, then I'm sure there's dozens of
Perl-knowledgeable people on this list who would be happy to help you.
Also try to find a Perl Mongers list near you (http://www.pm.org/,
IIRC).

-rob

Attachment: pgpxA1pHOR_6q.pgp
Description: PGP signature


Reply to: