Page 1 of 1
Search and Replace: Angle Brackets
Posted: 20 Jul 2022 13:53
by Jean001
Since upgrading I have noticed a problem with S&R and angle brackets in plain text. I'm fairly sure that I never had it in v6. The 'Current Value' and 'Replacement Value' windows show the correct before and after values, the record itself (e.g. Source) frequently has missing text after the replaced text. Even if the angle bracket is not used as part of the search text, if there is one in the line of text the problem still exists.
I am using S&R v.3.6.
Any help would be greatly appreciated.
Re: Search and Replace: Angle Brackets
Posted: 20 Jul 2022 15:21
by tatewise
Sorry Jean, but just saying you have a problem is too vague for me to investigate.
Is it simply that sometimes there is missing text after the replaced text?
Have you any repeatable examples?
In conjunction with
Search and Replace Error Message (20816) I wonder if something more subtle is going on.
Have you tried a PC
Restart (NOT
Shutdown)?
Have you tried reinstalling FH V7?
Re: Search and Replace: Angle Brackets
Posted: 20 Jul 2022 17:24
by Jean001
Thank you Mike. I have already tried Restart, to no avail.
Both of the Search and Replace problems started as soon as I upgraded, so I put them down to a quirk of the upgrade. I will do a re-install (that'll have to be tomorrow).
Here's a glimpse of the problem:
I am working in a Source Record, Text From Source box. Using Note produces the same results.
Original Text
< TXT Line 1
> TXT Line 2
++++++++++++++++++++++++++
TEXT BELOW HERE
aaaaaaa bbbbbbb ccccccc
==========================
Plain Text Mode
Case Sensitive
Part Words (No change if 'Whole Words' selected)
Show White Space
TEST 1
Search Criteria
·TXT
Replace
TXT
Actual Result
TXT Line 2
++++++++++++++++++++++++++
TEXT BELOW HERE
aaaaaaa bbbbbbb ccccccc
TEST 2
Search Criteria
<·TXT
Replace
TXT
Actual Result
TXT Line 1
TXT Line 2
++++++++++++++++++++++++++
TEXT BELOW HERE
aaaaaaa bbbbbbb ccccccc
Note: TXT Line 2 is very indented. The line looks as if it might begin with a tab but moving the cursor character by character from the end of the line to the beginning indicates a what I presume is a space character before 'TXT' then the cursor moves up a line, not to the 'left margin'.
(I see in Preview here that the 'tab' space before 'TXT' gets removed/ignored on posting.)
TEST 3
Search Criteria
>·TXT
Replace
TXT
Actual Result
The Text from Source Box now has no text.
Re: Search and Replace: Angle Brackets
Posted: 20 Jul 2022 18:08
by tatewise
Thank you Jean, that has enabled me to identify the problem.
In your Project, the Text From Source and Note fields are plain text but in FH V7 could be rich text.
However, they include < and > characters that have a special meaning in rich text unless prefixed with \ escape character.
The plugin was treating all such fields as if they were rich text and the replacement process mishandled the < and > chars.
The attached Search and Replace plugin Version 3.6.1 Date 20 Jul 2022 fixes the problem by checking if the field is actually in rich text format or plain text format before performing the replacement.
Re: Search and Replace: Angle Brackets
Posted: 20 Jul 2022 18:38
by Jean001
Many thanks, Mike.
That's resolved the problem.