[comp.mail.mh] Printing right-most N characters of a field for scan lines?

usenet@agate.BERKELEY.EDU (USENET Administrator) (03/02/88)

Is there a way to tell "scan" that I want the right-most N characters of
a given field, rather than the left-most N characters?  If not, has anyone
hacked the source to provide such a feature?  I'm using MH-6.5.

I would like this because most of my mail comes in via UUCP, and the left-most
N characters (where N is around 20 or 30) of a "From:" field are usually much
less useful than the rightmost N; the username of the person who sent the
mail is almost never within the first 20 or 30 characters, but is almost
always within the last 20 or 30.

I tried recompiling MH without the "BERK" and "DUMP" options, but that
didn't help much.  The programs tended to core dump rather often, and
the address parsing features enabled by leaving out "BERK" and "DUMB"
weren't really smart enough to do what I wanted anyway (basicly, what
I want to see is a user and the host that user is on; I don't care if
other stuff is there as well, but I'll ignore it).


Thanks!

-Brent
--
Brent Chapman					Capital Market Technology, Inc.
Senior Programmer/Analyst			1995 University Ave., Suite 390
{lll-tis,ucbvax!cogsci}!capmkt!brent		Berkeley, CA  94704
capmkt!brent@{lll-tis.arpa,cogsci.berkeley.edu} Phone: 415/540-6400

sow@cad.luth.se (Sven-Ove Westberg) (03/02/88)

If you want to print out the username instead of the left most
characters in the from field. 

If MH is compiled without the BERK option, (you didn't have a real
MH with this option :-), MH can separate the address field into different
parts.

My formatfile to scan printout the address in the following format.
From:  Donald Duck <donald@fo.foo.com>  (Guess who)
1) 	Donald Duck
2)	(Guess who)		if Donald Duck didn't exist.
3)	donald@fo.foo.com	if 1) or 2) didn't exist.

=================================================================

%4(msg)%<(cur)+%| %>%<{replied}-%| %>\
%02(mday{date})/%02(mon{date})%<{date} %|*%>\
%<(mymbox{from})%<{to}To:\
%<(nonnull(pers{to}))%17(pers{to})%|\
%<(nonnull(note{to}))%17(note{to})%|\
%17(friendly{to})%>%>%|\
%<{cc}Cc:\
%<(nonnull(pers{cc}))%17(pers{cc})%|\
%<(nonnull(note{cc}))%17(note{cc})%|\
%17(friendly{cc})%>%>%|\
%<{newsgroups}News:%15{newsgroups}%|\
%20(lit Missing to and cc)%>%>%>%|\
%<(nonnull(pers{from}))%20(pers{from})%|\
%<(nonnull(note{from}))%20(note{from})%|\
%20(friendly{from})%>%>%>  \
%{subject} %<{body}<<%{body}%>

=================================================================

Sven-Ove Westberg, CAD, University of Lulea, S-951 87 Lulea, Sweden.
UUCP:    {uunet,mcvax}!enea!cad.luth.se!sow
Internet: sow@cad.luth.se