Counting of Searched for Terms and Finding Duplicates

General questions about using TextPad

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

Post Reply
mhill
Posts: 13
Joined: Fri Jan 20, 2006 7:15 pm

Counting of Searched for Terms and Finding Duplicates

Post by mhill »

Hello.

I am presently using TextPad 5.0.3 (paid-version) on a Windows 2000 computer.

I recently volunteered to handle the constantcontact account for my church group. They have hundreds of people signed up for their monthly email newsletter and I am trying to clean up the code somewhat. Constantcontact must be powered by Microsoft FrontPage because it includes a LOT of excess HTML code. I have copied much code into TextPad and am trying to reduce the size of these emails. Anyhow, two questions come to mind, features that would make my task easier:

1) Is there a way to count words searched for? For example, I would like to copy a code block, or even the entire page, into a TextPad document, and do a search for opening DIV tags: <div>, as well as get a count of occurrences of this term. Then I would like to do a search for all closing DIV tags: </div>, and also do a count. That way, if there are a different number of opening tags than there are closing tags, I know a possible source of errors.

2) Is there a way to have TextPad find duplicate entries of a term? With hundreds of email addresses to keep track of, I would like to copy the list into a TextPad document and simply have it flag all duplicate entries. Is that possible, without having to manually conduct one search after another to check if addresses are not entered somewhere down the list?


--- Michael
User avatar
MudGuard
Posts: 1295
Joined: Sun Mar 02, 2003 10:15 pm
Location: Munich, Germany
Contact:

Post by MudGuard »

For counting the occurences of something, there is afaik no direct way - but: if you search and replace something, you get the number of replacements in the status bar.
Thus search for whatever you want to find out how often it occurs, and replace it with the same thing.

For duplicate entries:
if your email addresses are just a list of these addresses, as in
example@example.org
bla@example.net
foo@example.com
then you could sort the list, and activate the checkbox "Delete duplicate lines"
mhill
Posts: 13
Joined: Fri Jan 20, 2006 7:15 pm

Post by mhill »

Excellent!!

Thank-you.
nvj1662
Posts: 53
Joined: Thu May 17, 2007 10:02 am

Post by nvj1662 »

You get similar if you "mark" the sought element.
ben_josephs
Posts: 2461
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

If you mark the lines containing the item you see the number of lines containing it, not the number of occurrences of it. If there is no more than one occurrence per line, these numbers are the same.
User avatar
MudGuard
Posts: 1295
Joined: Sun Mar 02, 2003 10:15 pm
Location: Munich, Germany
Contact:

Post by MudGuard »

Another disadvantage of the Mark all variant:

it changes the bookmarks - and you can't undo that change. This doesn't matter if you don't have bookmarks set, but if you have some, you can't simply go back to having the previous bookmark set ...

The replacement with the search term can be undone (thus a file which is saved before searching will be marked unsaved by the replacement and be marked saved again after undo). Thus no side-effects ...
Post Reply