Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/iprakharv/unix-wc-tool
wc is a Python-based command-line tool that replicates some of the functionalities of the Unix wc utility. This tool allows users to count bytes, words, lines, and characters in a given text file or standard input.
https://github.com/iprakharv/unix-wc-tool
cli unix word-counter
Last synced: about 1 month ago
JSON representation
wc is a Python-based command-line tool that replicates some of the functionalities of the Unix wc utility. This tool allows users to count bytes, words, lines, and characters in a given text file or standard input.
- Host: GitHub
- URL: https://github.com/iprakharv/unix-wc-tool
- Owner: iPrakharV
- Created: 2024-10-21T17:01:53.000Z (3 months ago)
- Default Branch: master
- Last Pushed: 2024-10-21T17:41:11.000Z (3 months ago)
- Last Synced: 2024-12-08T11:43:06.172Z (about 1 month ago)
- Topics: cli, unix, word-counter
- Language: Python
- Homepage:
- Size: 133 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Unix Word Counter
`wc` is a Python-based command-line tool that replicates some of the functionalities of the Unix `wc` utility. This tool allows users to count bytes, words, lines, and characters in a given text file or standard input.
## Features
- Count the number of bytes in the text.
- Count the number of lines in the text.
- Count the number of words in the text.
- Count the number of characters in the text.
- Read input from a file or standard input.## Installation
Clone this repository to your local machine:
```bash
https://github.com/iPrakharV/Unix-wc-tool.git
```
Navigate to the cloned directory:
```bash
cd wc
```
## Usage
To use pywc, you can pass in a filename or pipe text into it from standard input. Here are some examples of how to use pywc:
```bash
# Count lines, words, and characters in a file
python3 wc.py test.txt# Count only lines from standard input
cat test.txt | python3 wc.py -l# Count only words in a file
python3 wc.py -w test.txt# Count only characters in a file
python3 wc.py -m test.txt# Count only bytes in a file
python3 wc.py -c test.txt
```
## Options
- -c, --bytes Count the number of bytes.
- -l, --lines Count the number of lines.
- -w, --words Count the number of words.
- -m, --chars Count the number of characters.
## Contributing
Contributions are welcome! Please feel free to submit a pull request or open an issue if you have suggestions or improvements.