Hello Mike,

On Wednesday, February 19, 2003 at 9:13 PM, Mike Dillinger [MD]
pressed random keys until the following was produced:

MD> I basically want to remove multiple blank/newlines from an email.

Ok, but you are aware that this solution will only work when you
*reply* to such a message, right?  There's nothing (internal) that we
can do for viewing these messages right now.

MD> I'd like to get rid of all of the unnecessary newlines and just have one
MD> newline between each section, like so:

That's what I thought.  In this case, do as I suggested and use the
wrap2 recursive engine.  You could use the form in the repository if
you want to wrap the other person's text.  If you want to preserve the
rest of the formatting, you would change the wrap2 template to look
like:

=====[Begin wrap2]=====
%IF:'%-
%SETPATTREGEXP="(?is-m)[^\n]+"%-
%REGEXPMATCH="%COMMENT"'<>'':'%-
%-
%SETPATTREGEXP="(?is-m)^(.*?)(\n(((\w{0,5}(\>\s*)+)?\s*\n))+(.*)\s*$|\z)"%-
%-%-%-%-%-%REGEXPBLINDMATCH="%COMMENT"%-
%-%-%-%-%-%SUBPATT="1"

%COMMENT=_%SETPATTREGEXP="(?is-m)^(.*?)(\n(((\w{0,5}(\>\s*)+)?\s*\n))+(.*)\s*$|\z)"%-
%-%-%-%-%-%REGEXPBLINDMATCH="%COMMENT"%-
%-%-%-%-%-%SUBPATT="7"_%-
%QINCLUDE="wrap2"'
=====[ End  wrap2]=====

Again, you need a driver template to run this one.  This one just
takes whatever is in the comment field, takes one paragraph at a time
from there and outputs it plus a blank line (thereby eliminating the
excess blank lines).

The driver template needs the following form:

%COMMENT="<raw text>"%-
%QINCLUDE="wrap2"%-
%COMMENT=""

The last line is just to cleanup loose ends.  Good luck!

-- 
Thanks for writing,
 Januk Aggarwal




________________________________________________________
 Current version is 1.61 | "Using TBTECH" information:
http://www.silverstones.com/thebat/TBUDLInfo.html

Reply via email to