markdown-word-count icon indicating copy to clipboard operation
markdown-word-count copied to clipboard

Support for folder with multiple files

Open alexandrebarbaruiva opened this issue 5 years ago • 3 comments

I'd love to see support for folders as I have many files in a single folder that I'd like to count.

alexandrebarbaruiva avatar Aug 10 '20 08:08 alexandrebarbaruiva

Hi Alexandre, thanks for the suggestion, that sounds very useful! Will add this to my todolist 😊

gandreadis avatar Aug 10 '20 14:08 gandreadis

I'd love to see this function too.

Wensupu-Yang avatar Mar 09 '22 14:03 Wensupu-Yang

Workarounds for *nix terminals (uses GNU style flags/arguments). Lists word counts for **/*.md files (all sub-directories).

# Only word counts.
find . -iname '*.md' -print0 | xargs --null --max-args=1 mwc

# Total word count in all files.
find . -iname '*.md' -print0 | xargs --null --max-args=1 mwc | tr '\n' '+' | sed 's/+$/\n/' | bc

# Word count per file, with filename/path, in a table.
find . -iname '*.md' -print0 | sort --zero-terminated | xargs --null --replace='{}' sh -c 'echo "{}" "$(mwc "{}")"' | column --table --table-right 2

joelpurra avatar Nov 02 '22 06:11 joelpurra

This was fixed in #17! Folder-counting is now available through globbing (*.md). Version v0.1.0 released for this.

gandreadis avatar Apr 15 '24 09:04 gandreadis