Re: Need Program to add > marks to text

"B. R. 'BeAr' Ederson" <[email protected]>
Newsgroups alt.comp.freeware
Organization A noiseless patient Spider
Message-ID <[email protected]>
On Sat, 15 Jun 2024 15:33:38 -0500, [email protected] wrote:

> I want to be able to copy/paste a text file and have the program place
> a > (Greater-than-sign) quote mark before each line of text.
> 
> I must also be able to control line length.
> 
> My Message Cleaner program will not work on my Windows 7 machine. It
> does this function fine on my XP comp.
> 
> Yes, I know that my newsreader does this job automatically on a Reply.

I'd use a Notepad++ macro for such a task. The following example pasts
the clipboard content to the current Notepad++ editor tab. (Should be
empty; else current unselected text will be included in the results.)
Then it selects all, does a couple of RegEx replacements, adds a last
CRLF, selects everything again and moves the text to the clipboard.
(The Notepad++ editor tab will be empty, again, afterwards. Therefore,
it will be ready to receive the next text for reformatting.)

Adjust parameters (line length,...) to your needs. Assign a shortcut to 
the macro or add it to the icon bar for quick access.

------------------------------------------------------------------------
<Macro name="ReWrap80_&amp;_Quote" Ctrl="no" Alt="no" Shift="no" Key="0">
            <Action type="0" message="2179" wParam="0" lParam="0" sParam="" />
            <Action type="0" message="2013" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1601" wParam="0" lParam="0" sParam="[^\r\n]+\K\R(?!\R)" />
            <Action type="3" message="1625" wParam="0" lParam="2" sParam="" />
            <Action type="3" message="1602" wParam="0" lParam="0" sParam=" " />
            <Action type="3" message="1702" wParam="0" lParam="512" sParam="" />
            <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" />
            <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1601" wParam="0" lParam="0" sParam="^(?=.{80,})(.{1,79})\s" />
            <Action type="3" message="1625" wParam="0" lParam="2" sParam="" />
            <Action type="3" message="1602" wParam="0" lParam="0" sParam="$1\r\n" />
            <Action type="3" message="1702" wParam="0" lParam="512" sParam="" />
            <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" />
            <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1601" wParam="0" lParam="0" sParam="^(.*)$" />
            <Action type="3" message="1625" wParam="0" lParam="2" sParam="" />
            <Action type="3" message="1602" wParam="0" lParam="0" sParam="&gt; \1" />
            <Action type="3" message="1702" wParam="0" lParam="512" sParam="" />
            <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" />
            <Action type="0" message="2318" wParam="0" lParam="0" sParam="" />
            <Action type="1" message="2170" wParam="0" lParam="0" sParam="&#x0D;" />
            <Action type="1" message="2170" wParam="0" lParam="0" sParam="&#x0A;" />
            <Action type="0" message="2013" wParam="0" lParam="0" sParam="" />
            <Action type="0" message="2177" wParam="0" lParam="0" sParam="" />
        </Macro>
------------------------------------------------------------------------

Please note, that the script inserts "> " (= with trailing space) and
does /not/ honor potential current quotation when re-wrapping. Therefore,
the script only works with unquoted text. Use the internal editor of your 
Newsreader or adjust the macro, if you need more flexibility.

HTH.
BeAr
-- 
===========================================================================
= What do you mean with: "Perfection is always an illusion"?              =
===============================================================--(Oops!)===
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.