Skip to content

KingChampion36/wc-tool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wc-tool

Coding Challenge: https://codingchallenges.fyi/challenges/challenge-wc/

Linux wc command

The functional requirements for wc are concisely described by it’s man page - give it a go in your local terminal now:

man wc

Size of a file

wc -c test.txt

Number of lines in a file

wc -l test.txt

Number of words in a file

wc -w test.txt

Number of characters in a file

wc -m test.txt

Compile and Run

Compile

javac WC.java

Run

1. Size of a file

java WC -c test.txt

2. Number of lines in a file

java WC -l test.txt

3. Number of words in a file

java WC -w test.txt

4. Number of characters in a file

java WC -m test.txt

5. Default option

java WC test.txt

6. No file name is specified (Take user input in this case) and print size

java WC -c

7. No file name is specified (Take user input in this case) and print number of lines

java WC -l

8. No file name is specified (Take user input in this case) and print number of words

java WC -w

9. No file name is specified (Take user input in this case) and print number of characters

java WC -m

10. No file name is specified (Take user input in this case) and default behaviour

java WC

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages