Word Counter is a command-line application that takes a path to a file as an argument and prints a word count of its contents.
- Download the content of this repository
- Open a terminal in the proyect folder (cmd, powershell, bash, ...)
- Run the .jar found in the jar folder of this repository with the path to a file as the first argument:
java -jar ./jar/WordCounter.jar [FILE PATH]
Important: This application has been developed using IntelliJ IDEA, so the following steps to generate the .jar only work using this IDE.
- Download the content of this repository
- Open this proyect in IntelliJ IDEA
- Click Build
- Click Build Artifacts
- A pop up will open with the WordCounter:jar Artifact, click Build.
This artifact is design to build the new .jar in the jar folder, so no further actions are required.
This repository includes four txt files that can be used to test the program located in the testFiles folder.
foo : 14
bar : 12
y : 1
foo : 14
bar : 12
y : 1
foo : 22
bar : 18
y : 2
foo_bar : 2
bar_foo : 2
foo : 22
bar : 18
y : 2
foo_bar : 2
bar_foo : 2
test1.txt and test2.txt have the same output because these files have the same text lines but in diferent order, test3.txt and test4.txt also have the same output for the same reason.