A simple example could be
texcount.pl example.tex -template="Words: {hword} in headers,
{word} in text, {oword} other places."
which should be all on one line.
An alternative way to specify this template is in the TeX document itself using the %TC instructions. Here's a more elaborate example of this:
%%% Template using new format (version 3 and on)
%TC:newtemplate
%TC:template Word count (text+headers+other):
%TC:template {text}+{headerword}+{otherword} = {sum}\n
%TC:template Element count (head+float+inline+dsmath):
%TC:template {header}+{float}+{inline}+{displaymath}\n
%TC:template Subcounts{SUB?: {sum}?SUB}
Note that \n indicates line shift which will have to specified explicitly.
You can also specify a template as well as other options in a separate options file, which may sometimes be convenient for big templates. For example, if you make a file with the contents
# Use as sum count: text words + header words + other words
-sum=1,1,1
# Output template
-template=
\<ul class=count>\n
\<li class=header>{title}</li>\n
\<li>Word count: {sum}</li>\n
\<li>Equations: {inline} inline, {ds} displayed</li>\n
\{float?<li>Floats: {float}</li>\n?float}
\{SUB?<li>Subcounts:</li><span class=subcount>\n
\| <li>{sum} words in {title}</li>\n
\|</span>\n?SUB}
\{file?<li>Number of files in all: {file}</li>?file}\n
\</ul>\n
you can include it using the -opt= option. This outputs the counts using HTML tags. The SUB section gives subcounts.
These examples, I hope, could make for starting points for experimenting.
.cfgfile. In particular, the script updates the.cfgon the basis of comment lines in documents. Probably not what you had in mind. – cfr Apr 21 '15 at 01:16