Dave wrote:

> This is better than anything I've dreamed up with sed or awk, and
> is really close, but it fails on this:

>  by nospam.mc.mpls.visi.com (8.11.6/ with ESMTP id

I know you want to avoid perl, but this kind of problem is it's
sweet spot.  The following might be incrementally better (though the
expression to recognize a dotted quad is technically incorrect):

perl -ne '
    next unless /^by/; 
    $_=pop @f; 
    push(@f,$_) if /^(\d{1,3}\.){3}(\d{1,3})$/; 
    print join(" ", @f)."\n";

I'm not fluent enough to translate it but I think awk has all the
required features to do so.

Tom McIntyre

Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
[EMAIL PROTECTED] mailing list
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to