learn_forever has asked for the wisdom of the Perl Monks concerning the following question:

Hi ! I want to read the uploaded addressbook (Outlook format) and parse this to get the email addresses out.

Please note that this script will be running under Linux and Apache and will not have a liberty of calling IIS / ActiveSate based specific win32 calls. So please suggest a way through which I will read the file and parse it to extract email addresses. Thanks Prasad

Replies are listed 'Best First'.
Re: Outlook Addressbook Import
by cacharbe (Curate) on Mar 13, 2002 at 04:21 UTC
    I would say that you should read rfc2426 which describes the vCard mime type which outlook can export to and read from. I've used this format for various projects, and it's my opinion that it would be the easiest method of cross platform access.

    C-.

Re: Outlook Addressbook Import
by tstock (Curate) on Mar 13, 2002 at 04:53 UTC
    You can export the address book to a CSV file and then read that. The only caveout is that some fields may contain newlines, so you can't equate end-of-line with end-of-record. I have no idea if the CSV modules out there handle this correctly, but last I checked (~1 year ago) they didn't. I believe you have an option in Outlook of what fields to export, so if you find it just export the fields you want.

    Tiago

      tillys Text::xSV handles linefeeds in CSV records, as long as the values are quoted. It's a pure Perl module and thus relatively slow, but I guess that importing stuff from the Outlook object model and/or the MAPI accesses would be the bigger bottleneck.

      perl -MHTTP::Daemon -MHTTP::Response -MLWP::Simple -e ' ; # The $d = new HTTP::Daemon and fork and getprint $d->url and exit;#spider ($c = $d->accept())->get_request(); $c->send_response( new #in the HTTP::Response(200,$_,$_,qq(Just another Perl hacker\n))); ' # web
Re: Outlook Addressbook Import
by Anonymous Monk on Mar 13, 2002 at 03:39 UTC
    And your question is *how* to read the addressbook? check cpan
Re: Outlook Addressbook Import
by ajwans (Scribe) on Mar 13, 2002 at 03:41 UTC
    You do not seem to be looking for wisdom, instead you appear to be looking for slaves.

    This is not a forum for getting other people to do your work for you.

    If you pose a specific question here the monks will be glad to help.

    1. dude, what does mine say?
    2. "sweet", what about mine?
    3. "dude", what does mine say?
    4. GOTO 2