Subject: converting elm aliases

From: [email-masked] (Paul Nanson)
Date: Tue, 22 Nov 1994 01:34:11 GMT

Are there any programs to convert an elm aliases.text file to
a pine addressbook?

--
Paul Nanson   [email-masked]  [email-masked] (BR)   PGP public key avail  

"Bipartisanship is for chumps." -- Tony Snow, Arkansas Democrat-Gazette

---

From: @kant.Physik.Uni-Dortmund.DE (Klaus Wacker)
Date: 22 Nov 1994 08:51:56 GMT

> Are there any programs to convert an elm aliases.text file to

Try this:

----------cut-here---------------------------------------------------
#!/usr/local/bin/perl
# 
# elm-to-pine: Convert elm aliases file to pine address book
# Author: Klaus Wacker ([email-masked])
#
# Usage e.g.
# elm-to-pine ~/.elm/aliases.text >~/.addressbook
#

# get a line, combining continuation lines
#  that start with whitespace
# (taken from the perl man page and modified)
sub get_line {
    return 0 if eof();
    $thisline = $lookahead;
  line: while ($lookahead = <>) {
      if ($lookahead =~ /^[ \t]/) {
	  $thisline .= $lookahead;
      }
      else {
	  last line;
      }
  }
    $thisline;
}

$lookahead = <>;	# get first line
while ($_ = do get_line()) {
    next if /^\#/;		# Skip comments
    chop;
    s/\t/ /g;			# Lets not get confused by tabs in the file
    ($nicks,$name,$address)=split(/ *= */,$_,3);
    @nick=split(/ *, */,$nicks);
    ($fullname,$remark)=split(/ *, */,$name,2);
    $fullname =~ s/;/,/;	# Lastname[;,] Firstname
    if ($address =~ /,/ ) {	# Its a list
	$address="(".$address.")";
    }
    foreach $nicki (@nick) {	# Pine doesn't allow multiple nicknames
	printf "%s\t%s\t%s\t\t%s\n",
	$nicki, $fullname, $address, $remark;
	$address = $nick[0];	# Let additional nicks point to the first one
    }
}
----------cut-here---------------------------------------------------

--
 
|  / |              | | |        |            [email-masked]
| /  |  _       __  | | |  _   _ |     _   _  Klaus Wacker, Exp.Physik V
|/\  |  _\ | | (_   | | |  _\ /  |_)  /_) |   Uni Dortmund
|  \_|_(_|_|_|___)  |_|_|_(_|_\__| \_/\___|   D-44221 Dortmund 
                                              +49 (231) 755 3587

---

From: Brent Blumenstein <[email-masked]>
Date: Tue, 22 Nov 1994 06:51:14 -0800 (PST)

I have a UniRexx script for doing this.  If you don't know what Rexx is 
then you don't need this script.

--
Brent A. Blumenstein                   | tel.:   206 667 4623
Fred Hutchinson Cancer Research Center | fax:    206 667 4408
1124 Columbia Street  MP-557           | e-mail: [email-masked]
Seattle, WA 98104    USA               |