Open ajsdkty3 opened 2 months ago
A lot of these features are already supported by the built in wc
command. Maybe you can enhance it instead? man wc
on a Linux machine will give you some inspiration.
Thanks for the suggestion! I've taken your advice and enhanced the wc command:
Objective: Enhance the wc command by adding a feature to count punctuation, digits, and uppercase/lowercase letters in a file. Description: wc Command Enhancement: Extend the existing wc to include additional features such as counting punctuation marks, digits, and the number of uppercase and lowercase letters in a file.
Features: Character Type Counting: In addition to counting lines, words, and characters, this enhancement will allow the user to count: Punctuation marks (e.g., ., ,, !, ?). Digits (0-9). Uppercase letters (A-Z). Lowercase letters (a-z). Options: -l: Count lines. -w: Count words. -c: Count characters. -p: Count punctuation marks. -d: Count digits. -u: Count uppercase letters. -L: Count lowercase letters.
Approach: Modify the wc command to parse new arguments for counting punctuation (-p), digits (-d), uppercase letters (-u), and lowercase letters (-L). Implement functionality to read the file and count these additional features along with existing lines, words, and characters. If the -h argument is used, the wc command will display help information, including details about the new counting features. Files to be modified/added: user: wc.c: Modify the existing file to include the new options and associated functions Future Development: Enhance the feature to allow users to count more specified symbols
Objective: Implement the count command to provide basic file content statistics.
Description:
count Command: The count command counts the number of lines, words, and characters in a specified file.
Features:
Content Statistics: Count lines, words, and characters in a file. Options: -l: Count lines. -w: Count words. -c: Count characters. -h: Display help information on usage. Approach: Update user space to introduce the count command. Implement functionality to read file content and calculate the number of lines, words, and characters based on command-line options. The count command will parse arguments to determine which statistics to output. If the -h argument is used, count will output simple help information and exit.
Files to be modified/added:
user: count.c (new file for implementing the count command) Future Development:
Enhance the command to support counting specific patterns or strings within the file.