Question
Java: Create a multithreaded program that reads all text files in a directory given by the user and creates a single output text file that
Java: Create a multithreaded program that reads all text files in a directory given by the user and creates a single output text file that counts the frequency of words found in all text files, combined. Ignore punctuation and symbols. Only words should be counted, and the program should automatically process ALL words in all input text files in the directory
example: suppose in a /textfiles directory, there exists:
input1.txt : "hello world"
input2.txt : "hello everyone"
input3.txt: "This is world for everyone"
input4.txt: "We are the world"
----------------------------------------------------------------------
Then either in the same directory or in a different directory, an output.txt file must contain:
hello: 2
world: 3
everyone: 2
is: 1
for: 1
this: 1
are: 1
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started