NEED HELP PLEASE! Write a Java program to read a text file (command line input for file name), process the text file and perform the following. Print the total number of words in the file. Print the total number of different words (case sensitive, meaning “We” and “we” are two different words) in the file. Print all words in ascending order (based on the ASCII code) without duplication. Write a pattern match method to find the location(s) of a specific word (a character string up to twelve characters, e.g. system). This method should return all line number(s) and location(s) of the word(s) found in the file. Print all line(s) with line number(s) of the file where the word is funds by invoking the method of 4). Under each output line indicate the location(s) of the first character of the matched word (refer to the output example below).
NEED HELP PLEASE! Write a Java program to read a text file (command line input for file name), process the text file and perform the following. Print the total number of words in the file. Print the total number of different words (case sensitive, meaning “We” and “we” are two different words) in the file. Print all words in ascending order (based on the ASCII code) without duplication. Write a pattern match method to find the location(s) of a specific word (a character string up to twelve characters, e.g. system). This method should return all line number(s) and location(s) of the word(s) found in the file. Print all line(s) with line number(s) of the file where the word is funds by invoking the method of 4). Under each output line indicate the location(s) of the first character of the matched word (refer to the output example below).
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
NEED HELP PLEASE!
Write a Java program to read a text file (command line input for file name), process the text file and perform the following.
- Print the total number of words in the file.
- Print the total number of different words (case sensitive, meaning “We” and “we” are two different words) in the file.
- Print all words in ascending order (based on the ASCII code) without duplication.
- Write a pattern match method to find the location(s) of a specific word (a character string up to twelve characters, e.g. system). This method should return all line number(s) and location(s) of the word(s) found in the file.
- Print all line(s) with line number(s) of the file where the word is funds by invoking the method of 4). Under each output line indicate the location(s) of the first character of the matched word (refer to the output example below).
- Empty lines are lines, they also have their own unique line numbers.
- Repeat the pattern match (4 and 5 above) until user types in EINPUT.
A word is defined by any combination of alpha and numerical characters (starting with alpha character), all other characters are delimiters. Note: no word in the input text file will start with a numerical character.
Input
The name of the text file should be read in from the Command line arguments, the input text file has a maximum of 80 characters per line and the size of the text file is less than two pages.
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 4 steps
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education