Skip to content

nullsploit01/cc-wc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Word Count Utility

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.

Features

  • 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.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

  • 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/.

Installing

Clone the repository to your local machine:

git clone https://github.com/nullsploit01/cc-wc.git
cd cc-wc

Building

Compile the project using:

go build -o ccwc

Usage

To run the utility, you can either pass a file name as an argument or pipe text into it via standard input.

Count lines in a file:

./ccwc -l filename.txt

Count words in a file:

./ccwc -w filename.txt

Count characters in a file:

./ccwc -m filename.txt

Count bytes in a file:

./ccwc -c filename.txt

Using piped input

cat filename.txt | ./ccwc -l

Running the Tests

go test ./...

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages