Hello everyone,
I find myself reformatting long file of datas using the Find/Replace dialog box in combination with RegExp (very powerful !). But… I would love to have an undo button to undo whatever replacement I just made. Right now, if I make a mistake in a replacement, I have to close my file without saving and do it again from the beginning…
Hope this would be easy to implement…
Thanks in advance.
On 25.08.2008, at 10:56, guerom00 wrote:
I find myself reformatting long file of datas using the Find/Replace dialog box in combination with RegExp (very powerful !). But… I would love to have an undo button to undo whatever replacement I just made. Right now, if I make a mistake in a replacement, I have to close my file without saving and do it again from the beginning…
This could be a bit tricky. As long as your replacements are independent it could work. Example: This could work: replace a by e replace u by X replace s by t
but this doesn't work (naïve expamle): replace a by e replace ed by XX
if you now say that replacing a by e was wrong the text becomes inconsistent. Thus I would use the normal TM undo functionality to go back. The last 10 find/replace string are stored anyway.
If I have to do a lot of replacements I always use a script (sed, perl, python, etc.) doing this and creating a new doc.
An other approach is to use git or svn for revision control. After each replacement one commits the changes to the repository automatically. Then you can go back in time easily. Or one writes a script which saves the current doc as file name plus time stamp and use it in a macro: - save with time stamp - open Find/Replace Dialog But this of course won't work for replacements which depends on each other.
Or did I misunderstand you?
--Hans
Wow… That's way too complicated…
Once I have clicked “Replace All” or “Replace in Selection”, I just would like an Undo button which would revert the file the way it was before I clicked. That's all…
On Aug 25, 2008, at 12:00 PM, guerom00 wrote:
Wow… That's way too complicated…
Once I have clicked “Replace All” or “Replace in Selection”, I just would like an Undo button which would revert the file the way it was before I clicked. That's all…
Maybe I'm missing something, but doesn't Edit › Undo (⌘Z) do this?
You're right… That's stupid =^D It is greyed out when the Find/Replace dialog has the focus so I though it was not possible. One just have to bring the focus to the main window…
On 25.08.2008, at 12:16, Alex Ross wrote:
On Aug 25, 2008, at 12:00 PM, guerom00 wrote:
Once I have clicked “Replace All” or “Replace in Selection”, I just would like an Undo button which would revert the file the way it was before I clicked. That's all…
Maybe I'm missing something, but doesn't Edit › Undo (⌘Z) do this?
I totally agree with Alex. This I meant by saying: On 25.08.2008, at 11:32, Hans-Jörg Bibiko wrote:
Thus I would use the normal TM undo functionality to go back. The last 10 find/replace string are stored anyway.
If you pressed ⌘Z you will find the last find/replace strings in the Find Dialog. Change them and go ahead.
--Hans