[pmmail-list] Export Address Books?

Dave Saville pmmail-list@blueprintsoftwareworks.com
Fri, 07 Nov 2003 08:06:53 +0000 (GMT)


On Thu, 06 Nov 2003 19:41:48 -0600, Treasure Mountain wrote:

>Can anyone tell me how to export individual address books from PMMail
>to The Bat?  As far as I can tell, the comma delimited export file
>doesn't indicate which address book the address comes from--just
>gives them all to you in one unsorted list.

Try this

/*  read pmmail address books and extract a book */

books = 'D:\Apps\SouthSide\Tools\books.db' /* adjust path */

do forever
     line = LineIn(books)

     IF Stream(books, 'S') = 'NOTREADY' THEN LEAVE
     parse var line name 'DE'X . 'DE'X . 'DE'X book 'DE'X .
     say name book
end

CALL Stream books, 'C', 'CLOSE'

say
say "Enter book number"
parse pull extract
say "extracting emails for book "||extract

book = 'D:\Apps\SouthSide\Tools\Addr.db' /* adjust path */

DO FOREVER
   line = LineIn(book)

   IF Stream(book, 'S') = 'NOTREADY' THEN LEAVE
   PARSE VAR line email 'DE'X alias 'DE'X name 'DE'X rmb 'DE'X
company 'DE'X title 'DE'X home_addr1 'DE'X home_addr2 'DE'X home_city
'DE'X home_county 'DE'X home_zip 'DE'X home_tel 'DE'X home_ext 'DE'X
home_fax 'DE'X bus_addr1 'DE'Xbus_addr2 'DE'X bus_city 'DE'X
bus_county 'DE'X bus_zip 'DE'X bus_tel 'DE'X bus_ext 'DE'X bus_fax
'DE'X notes 'DE'X book_number 'DE'X home_country 'DE'X
bus_country'DE'X

    if (pos("@", email) <> 0 & book_number = extract ) then do
      say '"'name||'","'||email||'",'   /* your extract code goes
here */
    end
END

CALL Stream book, 'C', 'CLOSE'

EXIT


That PARSE is one line BTW.


-- 
Regards

Dave Saville
- pmmail-list - The PMMail Discussion List ---------------------------
To POST to the list, send your message to:
pmmail-list@blueprintsoftwareworks.com

To UNSUBSCRIBE, send a message to mdaemon@bmtmicro.com 
with the first line of the message body being...
UNSUBSCRIBE pmmail-list@blueprintsoftwareworks.com
---------------------------------------------------------------------