[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [StrongED] Re: S & R query
In message <56b7b28716Lists@xxxxxxxxxxx>
"Richard Torrens (lists)" <Lists@xxxxxxxxxxx> wrote:
> In article <5424b0b756.Alan.Adams@xxxxxxxxxxxxxxxxxxxxxx>,
> Alan Adams <alan@xxxxxxxxxxxxxxxx> wrote:
>> Hi
>> Is there a way to use Search and Replace to replace two or more lines
>> of text with one different line?
>> If so, can part of one of the original lines be included in the
>> replacement line?
>> The example I want to do is:
>> Original text is
>> K%=FNwritebuf(A$,1)
>> IF K%>0 THEN PROCwarn("Could not send all data: "+STR$ K%+" bytes not
>> sent")
>> The replacement should be
>> PROCsendmessage(A$,1)
>> Where the A4 and 1 need to be copied from original to replacement, as
>> they could be, for example (b$,client%)
> <"K%" * $ * $
> finds K% at the start of a line, then searches forward for two line endings
> Replace would be simply
> "PROCsendmessage(A$,1)"
Thanks. That mostly solved it.
however:
Why $ and not \n in the search?
There is sometimes whitespace at the start of the line. There seems to
be a keyword White, but it's translation looks like something else
entirely.
{\x20} worked, as I didn't use tabs anywhere.
There were places where the second line was different, and i did not
want to replace those. Checking manually worked, but meant i could not
use replace-all. There were around 50 replacements needed.
I could not find a way to select out the things in the brackets and
replace them in the output line. Any attempt to use @ just said "line
not found".
In the end I found the exceptions i.e. where it has things like (B4,1)
or ("#",1) manually.
> However this is clearly a BASIC program - so I could be wrong!
> The instructions are near complete now and should certainly explain all of
> this
> http://diy.Torrens.org/RO/StrongED/man/search_adv.html
--
Alan Adams, from Northamptonshire
alan@xxxxxxxxxxxxxxxx
http://www.nckc.org.uk/
--
To unsubscribe send a mail to StrongED+unsubscribe@xxxxxxxxxxx
List archives and instructions at
http://diy.Torrens.org/RO/StrongED/index.html