|
Post by Stefan on Aug 31, 2023 11:10:44 GMT -5
Hi George,
Version v3.0.23242
I think there's something not quite right... The attached file is an excerpt of my iTunes LIBRARY.XML file The lines begin with one or more x'09' (Tab) chars, which I was seeking to eliminate when I noticed this anomaly. At first I thought the error only occurs at the start of lines, but it is more widespread than that.
To simplify your testing, I replaced the tab chars with '#' and also added some '#' blocks to illustrate the effect.
(1) Load the test.txt file
(2) Issue FIND ALL "#" +red .... Or any prominent colour you prefer to pop-out the '#' char sequences
(3) Issue CHANGE ALL "#" ""
I expected all red '#' chars to vanish - but they don't, when they appear consecutively in a string.
You can see the effect on the "#-triangle".
Also note the shifting of the 'before' and 'after' columns, which a Datashift wouldn't normally affect, given 3 blanks between the text items.
|
|
|
Post by George on Aug 31, 2023 13:18:40 GMT -5
Stefan: The Find/Change logic to setup positions for resuming a scan (either with RFIND/RCHANGE or just another full command) is exceedingly messy. Mostly because of the added oddball commands like SPLIT/JOIN and RSPLIT/RJOIN which impose unique requirements.
One thing I have noticed in the code is that if NULL operands are used, the DS variation is turned off. Probably because I simply could never get it to work.
I'm still on it, but it's worrying since changing things to fix your problem may trigger others. But what you are doing is a normal requirement, it used to work (ignoring DS) so what's gone wrong?
George
|
|
|
Post by Robert on Aug 31, 2023 15:04:49 GMT -5
I remember when DS/CS was implemented, since I was the one that nagged you into putting it in. AFAIK, once you put it to bed, it always seemed to work correctly (unless I missed some staff meetings). I am surprised that this would show up now.
R
|
|
|
Post by George on Aug 31, 2023 15:08:56 GMT -5
Stefan: OK, I think I've corrected it. It will need an addition to the Doc. re: the CS and DS change options.
Previously, if either the find or change operands were null, then DS was always 'turned off'. This was because these combinations could easily trigger a loop condition.
I have altered it so that if an explicit DS operand is coded to force DS, it will proceed in DS mode. If a loop ensues, well ....
George
|
|
|
Post by George on Aug 31, 2023 15:11:12 GMT -5
Robert: CS/DS were fine. It was handling null operands that was messed up. This has been a problem area for years.
George
|
|
|
Post by Stefan on Aug 31, 2023 17:02:16 GMT -5
George,
I'm less concerned about the DS issue, then the fact that the CHANGE command did not remove ALL the # characters which it should have done.
The # triangle was there to illustrate how a given number of consecutive chars (# on this case) are handled. I thought the before/after counts might provide a clue to the error.
|
|
|
Post by George on Aug 31, 2023 20:59:03 GMT -5
Stefan: It should now properly handle the repeating characters as well. At least until the next bug report.
George
|
|