cloc icon indicating copy to clipboard operation
cloc copied to clipboard

Count Characters

Open flofriday opened this issue 8 years ago • 2 comments

It would be nice if there was an option to count the characters instead of just the lines.

flofriday avatar Oct 22 '17 14:10 flofriday

It's a good idea, esp since some C/C++ styles call for a single brace character on a line by itself which becomes an exaggeration to call that a line of code. However the capability doesn't fit well with the existing cloc architecture. I'll leave this issue open but do not foresee an imminent solution.

AlDanial avatar Oct 26 '17 03:10 AlDanial

I finally used the unix command to combine

$ find books/ -name '*.md' | xargs wc -m | tail -l | awk '/total/{print $1}'

or

$ find books/ -name '*.md' -exec wc -m {} + |  awk '/total/{print $1}'

ref: https://stackoverflow.com/questions/35559648/how-can-i-count-the-number-of-words-in-a-directory-recursively

rxliuli avatar Oct 09 '22 00:10 rxliuli