Enhanced Search/Replace, tagged text in search as well
Posted: Mon Nov 24, 2003 2:20 am
Currently TextPad allows tagged text in search an replaces. This I use regularly to transform lines of texts.
However, I now need to process files which may have duplicate lines. For these lines I wish to tag them so that I can either delete all entries which are duplicated (that is delete both of them), or I may wish to delete everything which does not have a duplicate.
To do this I wanted to do the following search:
\(.*\)\n\1\n
Then I could select Mark-All.
I could use the same approach to remove duplicates (although this is already supported as an option on the Sort window) :
Search = \(.*\)\n\1\n
Replace= \1\n
This facility could also be used for other more complex types of searches.
However, I now need to process files which may have duplicate lines. For these lines I wish to tag them so that I can either delete all entries which are duplicated (that is delete both of them), or I may wish to delete everything which does not have a duplicate.
To do this I wanted to do the following search:
\(.*\)\n\1\n
Then I could select Mark-All.
I could use the same approach to remove duplicates (although this is already supported as an option on the Sort window) :
Search = \(.*\)\n\1\n
Replace= \1\n
This facility could also be used for other more complex types of searches.