[Date Prev][Date Next][Subject Prev][Subject Next][
Date Index][
Subject Index]
Re: U2 frame
- Subject: Re: U2 frame
- From: Harry Binswanger hb@xxxxxxxx
- Date: Sun, 11 Sep 2011 01:15:14 -0400
It's hard to keep use/mention levels straight, but I don't think yours does what mine does. What I'm after is changes with wildcards (i.e., varying text). E.g., one frame should change *all* the following in one swell foop:
The father left the son today. ==> The son left the father today.
The master left the slave today. ===> The slave left the master today.
The platoon left the sergeant today. ===> The seargeant left the platoon today.
So it functions like:
CI |The [W] left the [W] today.|The [W] left the [W] today.|
where the wildcards' meanings get reversed. Kinda like going from "The this left the that today" to "The that left the this today."
My routine SEarches for: |The [W] left [W] today.|, defines it, copies it below itself, defines the two of them, then cleans it up--all using wildcards. It requires a loop, of course to do the search through the whole file.
There might be 16 such changes required in a file, and you don't want to have to do 16 JMs, each specifying different literals.
On Sat, Sep 10, 2011 at 11:28 PM, Carl Distefano
mailto:cld@xxxxxxxx wrote:
Reply to note from Harry Binswanger mailto:hb@xxxxxxxx Sat, 10 Sep
2011 18:36:59 -0400
Harry:
> How [1] are [2] you?
>
> I want to end up with:
>
> How [2] are [1] you?
I'd handle this is with good old XPL parsing (XS operator). Here's a
demo. RUN it against itself. Experiment with different input strings
(S/G 01) and substrings to swap (S/Gs 02 and 03).
XPLeNCODE v2.0
b-gin [UNTITLED]
;*; http://SWAP12.PM [CLD 9/10/11][cr|lf];*; Swap all instances of{032}
two substrings in the input string (demo)[cr|lf];*;[cr|lf];*;
Usage:[cr|lf];*; With http://SWAP12.PM in current window, command:[
cr|lf];*; RUN http://SWAP12.PM[cr|lf];*;[cr|lf]{<}SV01,How [;
1] are [;2] you and [;2] you and [;1] you?{>};*; Input string
[cr|lf]{<}SV02,[;1]{>};*; Substring 1[cr|lf]{<}SV03,[;2]{>};*
; Substring 2[cr|lf];*;[cr|lf]{<}SV04,{>}{<}SX05,{<}IS01{>}{>
}{<}LBa{>}{<}IF{<}IS05{>}{240}{<}IS02{>}{>}{<}SV06,{>}{<}XS05
,02,07,,06{>}{<}LBb{>}{<}IF{<}IS07{>}{240}{<}IS03{>}{>}{<}SV0
8,{>}{<}XS07,03,09,,08{>}{<}SX07,{<}IS09{>}+{<}IS02{>}+{<}IS0
8{>}{>}{<}GLb{>}{<}EI{>}{<}SX04,{<}IS04{>}+{<}IS07{>}+{<}IS03
{>}{>}{<}SX05,{<}IS06{>}{>}{<}GLa{>}{<}EI{>}{<}LBc{>}{<}IF{<}
IS06{>}{240}{<}IS03{>}{>}{<}SV08,{>}{<}XS06,03,07,,08{>}{<}SX
06,{<}IS07{>}+{<}IS02{>}+{<}IS08{>}{>}{<}GLc{>}{<}EI{>}{<}SX0
4,{<}IS04{>}+{<}IS06{>}{>}[BF_]Old: {<}GT01{>}[255+048+068]Ne
w: {<}GT04{>}[255+048+068]{<}EX{>}[cr|lf][cr|lf]
-nd
XPLeNCODE
--
Carl Distefano
mailto:cld@xxxxxxxx