Adding number of instances of a word or phrase found in a note to "Search file"

Use case or problem

I’m trying to find the number of times I wrote a specific word or phrase in a single note.

Proposed solution

I think this feature could easily be implemented in the current “search file” (CTRL + F) or “search & replace” (CTRL + H) function for finding instances of a word or phrase in a note. It would just need to also count how many instances it finds and display it on-screen.

Current workaround

The ways I currently see to do this are:

  • Using the current “search file” menu via CTRL + F and going from instance to instance manually, counting until I reach the bottom of the note.
  • Copy-pasting the note into Microsoft Word or another program and finding the number of counts from there.
  • Creating a program in python or another programming language that auto-counts (I’m not very experienced in programming myself though so I have not tried this yet)
13 Likes

Hello,
I am looking for something like this. I want to know how many times I used a word in a document. Have you found a solution to this?

1 Like

Hi, unfortunately I have not found a solution to this yet. The closest thing I have found is the Better Word Count plugin, but that only returns the number of words and characters in a single highlight, not number of specific words or phrases in a document. Otherwise I’ve been primarily using the workaround of copy-pasting into Microsoft Word or exporting to PDF whenever I’ve needed to find number of instances.

3 Likes

I would like to echo a request for this feature. As a writer (not wanting to repeat the same word too often) it would be handy to search a note and see how many occurrences of that word are present.

1 Like

+1; Should(?) be a really easy addition to the “find” function, as well as possibly the global search, is to simply display the number of results.

Use case or problem

When using the search function, I would like a feature to count of the number of records found in a search. This would be a great help when comparing two or more searches to see if the count is different.

Proposed solution

This could be acheived in a simular way to the way the community plugin “file explorer folder count” works.

2 Likes

I will also add that there should be the current position displayed, such as x/y or x of y, when seeking (next, prev) through matches in the find search.

I found a workaround! And I’d also like to add a big +1 because this feature - showing “Result x of y” when using CTRL + F within a note would be so much more user friendly.

Workaround: use the vault-wide search to search for the filename, then the search term.

  1. Expand sidebar
  2. Click the magnifying glass
  3. In the vault-wide search, enter file:name_of_note "search term"

That view will show you the number of times your search term was found within the note. If your search term is rare, you can even omit the filename.

I understand that keeping conversations in single threads helps the community, but am I allowed to link to a similar thread that was opened around the same time? The reason being that while it is less well explained and has fewer replies, it has 24 likes.

1 Like

Find count (x of y) is an absolutely essential feature of Obsidian that is missing. For a reference on how this feature should work, please refer to the in-editor Find and Replace feature of Visual Studio Code.