The wc-tool
is a command-line utility written in Go that provides word counting and file statistics functionalities. It allows you to analyze the content of text files, either through standard input (pipe) or by specifying a file name and an option.
This tool was inspired by the Word Count Challenge, providing a practical implementation of word counting and file statistics with additional features.
- Count bytes, lines, words, and characters in text files.
- Handle both standard input and file input.
To use the wc-tool
with standard input, you can pipe the content to the tool and specify an option:
<some_command> | wc-tool -option <option>
echo 'Hello, world!' | wc-tool -option w
>>> Word count: 2
To use the wc-tool with a file, provide the file name and an option:
wc-tool -option <option> <filename>
wc-tool -option b example.txt
>>> Byte count in example.txt: 51
b
: Print byte count.l
: Print line count.w
: Print word count.c
: Print character count.- No option: Print byte, line, word, and character count.