This project is a custom implementation of the classic Unix wc command. It was created as part of a coding challenge here. The utility is designed to perform byte, word, line, and character counts on text data either from a file or standard input.
- Count bytes in the input text.
- Count words in the input text.
- Count lines in the input text.
- Count characters in the input text.
- Handle input from both files and standard input (piping).
- Efficiently process large files up to 100MB in size.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
- You need to have Go installed on your machine (Go 1.15 or later is recommended).
- You can download and install Go from https://golang.org/dl/.
Clone the repository to your local machine:
git clone https://github.com/nullsploit01/cc-wc.git
cd cc-wcCompile the project using:
go build -o ccwcTo run the utility, you can either pass a file name as an argument or pipe text into it via standard input.
./ccwc -l filename.txt./ccwc -w filename.txt./ccwc -m filename.txt./ccwc -c filename.txtcat filename.txt | ./ccwc -lgo test ./...