writing a java program class called ProcessFileIO for file I/O processing. Use current directory for both
Question:
Usecurrent directoryfor both input and output files in this question.
Make an input text file named "SampleData.txt" in current directory and produce output text file named "OutputReport.txt" in current directory with processing as described below.
The program is supposed to work for any input text data (comma delimited) inSampleData.txt; however, we are providing an example text data below. The SampleData.txt file should include multiple lines with a set of strings which are numeric, alphabetic, and alphanumeric characters incomma delimitedformat.
Example:Text data (five lines) forSampleData.txtfile:
9,number9,java27,,8,Python,Sample3Text 90,number90,java270,Ď,80,Python,Sample30Text 010ABCD,2Java7,0test3,72D9,Windows95,1Test2Test8, Linux b = 10sample5,Account BMO-000-001-9683, a=0,b=00,c = 2,d = 4,e = 3, text0**5
The program should create an output text file namedOutputReport.txtthatonlykeeps the numeric substrings in each record of input text file in comma-delimited format as well.
Example:Output text data (five lines) inOutputReport.txtfile as an answer to input text data given above.
9,9,27,027,8,3 90,90,270,0270,80,30 010,27,03,729,95,128 105,0000019683 0,00,2,4,3,05
Your program should also create an ArrayList of integers representing the number of substrings that illustrate the odd integers in each record ofOutputReport.txtfile.
Example:[5, 0, 4, 2, 2] is the resulting ArrayList of integers for example above (i.e., the number of odd integers in each output record).
Finally, your program should print the ArrayList and a note for name and location of the output file as follows:
The program should end after printing the above results.
Hint: You may use the following statements to extract numeric tokens from input file record (to replace all occurrences):
String str = ;
str = str.replaceAll("[^0-9.]", );
Note:
Any expression indicated by <...> should be replaced by an appropriate statement.Write a java program class called "ProcessFileIO"for file I/O processing.
Usecurrent directoryfor both input and output files in this question.
Make an input text file named "SampleData.txt" in current directory and produce output text file named "OutputReport.txt" in current directory with processing as described below.
The program is supposed to work for any input text data (comma delimited) inSampleData.txt; however, we are providing an example text data below. The SampleData.txt file should include multiple lines with a set of strings which are numeric, alphabetic, and alphanumeric characters incomma delimitedformat.
Example:Text data (five lines) forSampleData.txtfile:
9,number9,java27,,8,Python,Sample3Text 90,number90,java270,Ď,80,Python,Sample30Text 010ABCD,2Java7,0test3,72D9,Windows95,1Test2Test8, Linux b = 10sample5,Account BMO-000-001-9683, a=0,b=00,c = 2,d = 4,e = 3, text0**5
The program should create an output text file namedOutputReport.txtthatonlykeeps the numeric substrings in each record of input text file in comma-delimited format as well.
Example:Output text data (five lines) inOutputReport.txtfile as an answer to input text data given above.
9,9,27,027,8,3 90,90,270,0270,80,30 010,27,03,729,95,128 105,0000019683 0,00,2,4,3,05
Your program should also create an ArrayList of integers representing the number of substrings that illustrate the odd integers in each record ofOutputReport.txtfile.
Example:[5, 0, 4, 2, 2] is the resulting ArrayList of integers for example above (i.e., the number of odd integers in each output record).
Finally, your program should print the ArrayList and a note for name and location of the output file as follows:
The program should end after printing the above results.
Hint: You may use the following statements to extract numeric tokens from input file record (to replace all occurrences):
String str = ;
str = str.replaceAll("[^0-9.]", );
Note:
Any expression indicated by <...> should be replaced by an appropriate statement.
Practical Introduction To Data Structures And Algorithm Analysis Java Edition
ISBN: 9780136609117
1st Edition
Authors: Clifford A. Shaffer