Macro: Match Line Substrings and Delete a line

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
dbthj
Posts: 11
Joined: Fri Oct 09, 2009 1:49 pm

Macro: Match Line Substrings and Delete a line

Post by dbthj »

I have reduced a log file a great deal using Textpad commands.
What I have now has many similar lines still to eliminate.

I want to walk through the file, select a substring of each line,
remember it, move to the next line and compare the same character
numbers. If the two substrings are the same, I want to delete the second string.

Eventually, the strings will not match. Repeat the process.

Example:
before applying macro:

aaa bbb ccc ddd
xxx yyy this and that
xxx yyy something else
xxx yyy again different
aaa mmm lll
xxx yyy holy mackeral
xxx yyy again different
xxx yyy this and that
xxx yyy something else


After applying the macro this becomes:

aaa bbb ccc ddd
xxx yyy this and that
aaa mmm lll
xxx yyy holy mackeral
Post Reply