[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: More AppleWriter 2.1 HELP! (search)



In article <4uu7a5$mnt@login.freenet.columbus.oh.us>
dalloff@freenet.columbus.oh.us (Dave Althoff) writes:
>I thought I knew AppleWriter pretty well...
>
>But what I really wanted to do last night was to [F]ind carriage return
>characters.  I know it's in there, but I can't for the life of me remember
>the wildcard I need to use.  I was trying to convert Apple line turns to
>MS-DOS line turns, and while I'm sure there are other utilities that can
>do it, AppleWriter should have been able to do it painlessly.  I wanted
>the equivalent of...
>
>Find:  /^M/^M^J/a
>
>Earlier, I had been able to convert MS-DOS line turns to Apple line turns
>with...
>
>Find:  /^J//a
>
>And I have another editor that can do a really nice job of UNIX NewLines...
>
>Anyone remember the code?

Yes.

The secret is to choose the right delimiter.  If the delimiter is any
character other than ! or /, then the next three ASCII codes are the
wildcard and carriage-return-matching characters.  For example, if "<" is
the delimiter (as it frequently is in the examples in the manual, and in
the WPL programs on the Applewriter disk), then "=" is the match-any-length
wildcard, ">" matches carriage return, and "?" is the match-one-character
wildcard.  Other examples:

     delimiter   match   match   match
                  any     CR      one
     ---------   -----   -----   -----
        #          $       %       &
        +          ,       -       .
        :          ;       <       =
        \          ]       ^       _

I believe you can even use letters and digits like this, though I don't
recommend doing so unless you're fond of confusion.

Thus, the following should do what you want:

     [F]ind: <><>J>a

(where the "J" is an inverse "J" that you get by pressing control-J or the
down-arrow key).

Tip-o'-the-day:  Put the find command, and its reverse, into WPL programs,
so you can add or remove LFs whenever you want like this:

     [P]rint/Program: DO ADD.LF
     [P]rint/Program: DO STRIP.LF

               - Neil Parker
-- 
Neil Parker                       | No cute quote, no cute ASCII art, no cute
nparker@cie-2.uoregon.edu         | disclaimer, no deposit, no return....
nparker@cie.uoregon.edu           | (This space intentionally left blank:
http://cie-2.uoregon.edu/~nparker |                                           )