I would like to find number of occurrence of specific words in a tex file. For example, I need to find out number of "the" used. It is foolish to just "ctrl+F" to find word by word because I am working with a book.
So, I would like to ask if there are any solutions that any commands or extensions can help like: "The total number of "the" is 2345 in the text." (just like the searching function of web browser, Chrome.)
I have been finding old posts but I have found nothing related to my specific problem. I know "texcount" can help the total number of words but it seems it does not suit my current problem.
Thank you in advance.
Here is my example:
\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\begin{document}
While psychological knowledge is often applied to the assessment and treatment of mental health problems, it is also directed towards understanding and solving problems in many different spheres of human activity. The majority of psychologists are involved in some kind of therapeutic role, practicing in clinical, counseling, or school settings. Many do scientific research on a wide range of topics related to mental processes and behavior, and typically work in university psychology departments or teach in other academic settings (e.g., medical schools, hospitals). Some are employed in industrial and organizational settings, or in other areas[9] such as human development and aging, sports, health, and the media, as well as in forensic investigation and other aspects of law.
\end{document}
So, is there a simple way to sort out number of "the" used in this short paragraph?
\documentclass{...}and ending with\end{document}. – May 28 '14 at 03:51the, that there might be the\the...commands, also being counted, but happily not in the MWE you provided. Texcount does only count the total number of all words, as far as I know (never used it, shame on me ;-)) – May 28 '14 at 04:01XeLaTeXanyway? – May 28 '14 at 04:04grep -oc Hence file(s).tex– morbusg May 28 '14 at 05:20-freqoption. Does that fulfill your needs? – Einar Rødland May 28 '14 at 10:49.auxfor example. – May 28 '14 at 05:23