Author Topic: Issue with Lee Mac's Batch Find & Replace Text  (Read 2041 times)

0 Members and 1 Guest are viewing this topic.

BazzaCAD

  • Guest
Issue with Lee Mac's Batch Find & Replace Text
« on: January 04, 2018, 04:03:28 PM »
Hi everyone & I'm sure Lee will be reading this too ;-)
I'm using your Batch Find & Replace Text, but I'm having an issue.
http://www.lee-mac.com/bfind.html

We have some old drawings that were created with fractions from symbols before stacked fractions were a thing.
Here you can see one of them:


When I run the find & replace, I get this...


Attached is the dwg in question & the output report.

Any ideas on how to get this to work?
(Yes, I know "1/2" won't give me a stacked fraction, I was just using it as a test)



Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: Issue with Lee Mac's Batch Find & Replace Text
« Reply #1 on: January 04, 2018, 04:37:22 PM »
Hi Barry,

Well, you've certainly caught my attention. :-)

Whilst developing the find/replace engine for this application in conjunction with Joe Burke, in order to perform find and replace operations on text content which could potentially be interspersed with MText formatting codes, the engine performs a temporary substitution of all MText formatting codes with an obscure (and essentially arbitrary) character that we estimated would be rarely used in drawings.

This character just so happens to be ASCII character 208, the very character that you are trying to replace...

In my more recent development projects involving MText formatting code acrobatics (such as here), I instead use the unprintable (and appropriately named) 'SUB' character "\032" (Octal 32 / ASCII 26).

Therefore, as a quick workaround, you could find/replace all instances of (chr 208) with (chr 26) and all instances of "Ð" with "\032" in the code for my Batch Find & Replace program - this should hopefully avoid the issue.

Lee




BazzaCAD

  • Guest
Re: Issue with Lee Mac's Batch Find & Replace Text
« Reply #2 on: January 04, 2018, 05:14:15 PM »
Hi Lee,
Thanks for the quick reply. That makes perfect sense. I was wondering why it seems to be making substitutions where there was nothing to substitute.
I changed the code & it's working perfectly now.

Thanks much.

cmwade77

  • Swamp Rat
  • Posts: 1443
Re: Issue with Lee Mac's Batch Find & Replace Text
« Reply #3 on: January 05, 2018, 01:43:13 PM »
Hi Barry,

Well, you've certainly caught my attention. :-)

Whilst developing the find/replace engine for this application in conjunction with Joe Burke, in order to perform find and replace operations on text content which could potentially be interspersed with MText formatting codes, the engine performs a temporary substitution of all MText formatting codes with an obscure (and essentially arbitrary) character that we estimated would be rarely used in drawings.

This character just so happens to be ASCII character 208, the very character that you are trying to replace...
I have certainly been guilty of doing stuff like this in some of my code, saying "oh that character or phrase will never get used" and then someone decides to use it and results are about the same as this.