Find / Replace - here: Global Replace

Legacy MyInfo versions topics and topics that are no longer relevant
Locked
Fred
Posts: 216
Joined: Wed Jun 23, 2010 8:07 pm

Find / Replace - here: Global Replace

Post by Fred »

At this time, the Find / Replace commands do just work for the actual doc = item. For Find, this is ok since for finds in the whole topic, we have the FindDocuments command.

But a Replace command working on several targets would be handy, be it just a "Global" option working on the whole topic, or even a more refind option "This document and all its sub-items" (= which would be the same when your topic has a root item (which is not mandatory) and when that root item is selected).

Just imagine an author who wants to rename one of his characters!

For the time being, I use a macro (here for replacing a word in the whole tree, but similarly, you can do it for subtrees, when you shuffle these subtrees to the end of your tree so that nothing-not-to-be-affected will be afterwards):

a) Assure that you are in the tree, on its first item. Do ExpandAll. Have a macro program that allows for repeating a macro x times. Have a look into the menu File-Properties&Security(or by shortkey)-Statistics, in order to know the real item count in your topic (the item count in the status line does NOT give the overall item count).

b) For the first item "manually", just do the replacement in order to have the right words and options in the Find-and-Replace dialog. Go back to the tree.

c) Your macro should then repeat these steps x times:

- GoText (by shortkey for SwitchForward)
- PAUSE*
- Control-Home (perhaps not really necessary, but cannot do any harm)
- Little Pause
- Replace (by shortkey, opens the dialog)
- Little Pause
- Alt-a (for ReplaceAll)
- PAUSE
- Return*
- Little Pause
- Escape (closes the search and replace dialog)
- Little Pause
- GoTree (by shortkey for ShowTree or SwitchBackwards)
- Little Pause
- Down (by Down Arrow)
- and again...***

* = Well, that's the drawback of this macro approach, and which is the reason for which inbuilt GlobalReplace functionality would be much appreciated. Since some docs, rather long, need some loading time, and afterwards, some time to be searched, these two PAUSES are absolutely necessary in order for your macro don't crash! And since you don't know which items will be voluminous, you need these PAUSES for EVERY document in your topic. Depending on the character of your topic - max size of your docs - and on the speed of your comp, I would allow for 3 seconds normally here in order to be absolutely sure your macro works well, but much more if you have big docs in it, for example complete laws in order to compare them with new versions in the web (I use Beyond Compare for this; unfortunately there isn't yet any in-built text comparing software in any program such as MI: here's a hint to Milenix: integrate such an in-built functionality by licensing it, would make a tremendous advantage over ALL competiting softwares). For the Little Pauses, just allow for 100 ms, that will do on most systems.

** = Very fortunately, there is either the message "Replaced x times" or the message "Did not find", and both are to be closed by a Return. If one of these would have to be closed by an Escape and the other one by a Return, or if, if unsuccessful, an additional dialog would open, you would be in deep trouble. But as it is, this simple macro works, with most macro programs. Thank goodness!

*** = Fortunately, if your macro does that loop too many times, nothing bad will happen, it will just search repeatedly (and unsuccessfully) your last doc the remaining times. This way, you could implement your macro for let's say a hundred loops if most of your topics do not comprise more than that amount of docs, and you wouldn't have to adjust your macro but for a bigger topic. But of course, an in-house functionality would be much better since most of all, it would spare us that COFFEE PAUSE just for doing that single replace in just one topic... and if you have to replace more than one word in your topic, that will make a lot of coffee, a lot of fuss, since after each replace run, you'll have to replace "manually" the search and replace terms in your dialog (but not in your macro at least, since the macro just does your specific search and replace, but a given, not the just right number of times, without your manual intervention).

And of course, this Global Replace should work on those special characters, EndOfLine, EndOfParagraph, etc., mentioned in my other posting... since for eliminating such unwanted spaces at end of lines, etc., I would need it most...
Fred
Posts: 216
Joined: Wed Jun 23, 2010 8:07 pm

Post by Fred »

I said above:

"unfortunately there isn't yet any in-built text comparing software in any program such as MI: here's a hint to Milenix: integrate such an in-built functionality by licensing it, would make a tremendous advantage over ALL competiting softwares)"

Well, that's not right, ConnectedText has it! But then, CT is not giving us trees freely, so, it's perhaps the most elaborate information manager (for individual users, that is) currently, but I cannot do anything with it, the wiki concept is beyond me, and remember, heavy searching was invented in order to make wikis run! (At least that's my strong opinion, without knowing anything on these matters, yeah!)

So, very few people would ever change to CT in order to have this text comparing facility.

And by this, MI would indeed have a VERY strong point in having one! Again, BeyondCompare being the best one in my opinion, at least among those that ain't "out of price", perhaps Scooter Software is willing to give a licence?

Of course, this would be a Prof. version's feature, but then, 89 dollars without, or 99 dollars, with BC incorporated, wouldn't it be a great idea if they are willing to have this fine piece of software integrated in MI... especially so since afterwards, they could do some integration into other programs, MI being a reference implementation for them in this respect?!
Locked