Occurences found when using 'Find in Files'

General questions about using TextPad

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

Post Reply
mattcase
Posts: 2
Joined: Fri Oct 03, 2003 5:16 pm
Location: St. Louis, Missouri

Occurences found when using 'Find in Files'

Post by mattcase »

I've noticed recently that when I do a 'Find in files', the 'Found # Occurences' in the 'Search Results' actually counts lines it found that contained the text I search for. So, if that line contains more than one match, the number of occurences is now incorrect.

I've noticed though that if I then do a 'Replace' using the same text I just did the search with that the 'Replaced # occurence(s)' is the status bar is correct.

This can (and did for me) cause a little bit of confusion, especially when performing these operations on large files that contain many occurences of the search text.

Does this sound like a bug?
Dcantor
Posts: 18
Joined: Wed Sep 03, 2003 3:30 pm
Location: Groton, CT

There are legitimate needs for both kinds of counts.

Post by Dcantor »

It doesn't sound like a bug to me. I'm usually interested in the number of lines in which a match is found. Perhaps the report wording for the find operation should be "Found nn lines". It would be even better if the report was "Found nn occurences in xx lines," assuming both nn and xx are correct, of course.

For replacement, I agree with the original poster -- the number of occurences replaced should be reported with _perhaps_ the number of lines, as "Replaced nn occurences in xx lines."

If only one of the two possible counts is possible, I would opt for number of lines for find and number of actual occurences for replacements. Perhaps, if only one kind of count is possible, there could be a radio button selection (either global or per document class and maybe even for the current document only).

Dave C.
Dave C.
Groton, CT
Post Reply