I am trying to get the words cumber per section using the following lines:
\newcommand\wordcount{
\immediate\write18{texcount -sub=section \jobname.tex | grep "Section" | sed -e 's/+.*//' | sed -n \thesection p > 'count.txt'}
(\input{count.txt}words)}
as in: Dynamically count words in chapter and insert word count at start of chapter or wordcount by section when sections were formally known as chapter
however, the words are not counted. But no error pops up.
In the pdf output it appears:
Many thanks in advance for your suggestions

count.txtfile produced? What's your OS and TeXcount version? Have you set theshell-escapeoption required for running commands from TeX? – Einar Rødland Aug 11 '20 at 18:27count.txtis not produced. I think that is actually the main issue (besides my lack of computational skills)Additional information: OS:64-bit version ; TeXcount_3_2.
The
– Rui Aug 12 '20 at 06:53shell-escapeoption was set as in: https://tex.stackexchange.com/questions/99475/how-to-invoke-latex-with-the-shell-escape-flag-in-texstudio-former-texmakerxtexcount -o count.txt \jobname.texand see if this still fails. You can also tryecho "test" > count.txtjust to see if it actually runs. I also have some vague memory of some version of TeX that took a different option thanshell-escape. – Einar Rødland Aug 12 '20 at 18:43