[Date Prev][Date Next][Subject Prev][Subject Next][ Date Index][ Subject Index]

RE: massive search and replace failures



Reply to note from "Chuck Creesy" 
Wed, 28 Feb 2001 17:58:12 -0500

> I was hoping for an easy answer that wouldn't require going
> into detail

Weren't we all.

> The command:
> ≪LBloop≫BX sea |[CDATA[|Q2 ≪IF≪ER≫≫≪EX≫≪EI≫DF
> BX sea |]]|Q2 DF BX (cha/s |=E9|é|)BX .... etc etc ....
> (accented character looks different in DOS of course)
> .....XD ≪GLloop≫

One possibility: Although quoted-printable encodings such as =E9 are
supposed to be uppercase, it's fairly common to see them in
lowercase (=e9) as well. The relevant Internet standard (RFC 1521)
recognizes as much: "Uppercase letters must be used when sending
hexadecimal data, though a robust implementation may choose to
recognize lowercase letters on receipt." This counsels use of a
case-insensitive CHange command -- recognizing that case is always
preserved on the "replace" side, so that you're OK on the difference
between, say, "é" and "É". Also, BX Q2 is generally
more reliable than BX (). Also, insert a WAIT command after each
CHange; can't hurt, might help. So you'd have:

BX ch/s |=E9|é|Q2 BX waitQ2 ;*;

> File size is typically between 2 and 3 MB.

Theoretically, that shouldn't be a problem. But in case these
anomalies are related to file size, you might consider fortifying
your code in several ways. First, make sure that your file is in
eXPanded view when the CHange operations are done. Also, you could
force each CHange command to repeat until an ERror condition is
encountered:

BX ch/s |=E9|é|Q2 )>BX waitQ2 ;*;

Repeat that procedure for each CHange command, using a different
LaBel/GoLabel for each one.

Additionally, instead of CHanging DeFined (Selected) text, you could
MoVe each DeFined block to an alternate screen -- put BX ne/100Q2 AS
near the top of your program, to open an Untitled screen in eXPanded
view -- and do your CHange operation there, without the /S switch,
i.e., from top to bottom of file, thus effectively reducing file
size to the length of the DF block; then DeFine and MoVe the result
back into the original file. Thus:

DF ... DF AS MV TF ;*;
BX ch |=E9|é|Q2 )>BX waitQ2 ;*;
DF BF DF AS MV ;*;

Let us know if any of this helps.

--
Carl Distefano
cld@xxxxxxxx
http://users.datarealm.com/xywwweb/