Text File Statistics Tool (wc clone)
A command-line utility that counts lines, words, characters, and longest line length across one or more text files, mimicking core wc functionality plus extra stats. Learners practice file I/O with fopen/fgetc, command-line argument parsing, and buffered reading in C.
- Estimate
- ~6.5h
- Steps
- 5
- Completed by
- 0
- Proposed by
- codeseed.app
stdio.h · getopt
Project roadmap
- 01
Implement single-file counting logic
~1.5hWrite a function that reads a file character by character and tallies lines, words, and characters.
- 02
Add longest-line tracking
~1hExtend the counting loop to track the length of the longest line encountered.
- 03
Support multiple files and totals
~1.5hLoop over multiple filename arguments, printing per-file stats and a combined total row.
- 04
Add getopt-based flags
~1.5hSupport -l, -w, -c, -L flags to selectively print only chosen statistics, matching wc's interface.
- 05
Handle stdin input
~1hWhen no filename is given, read from stdin so the tool works in pipelines.
Resources
Ready to build this?
Get a GitHub repo and start building. Your AI reviewer checks each step as you go.
Tech stack