CS-159: FILE I/O Lab |
Objectives: |
To gain practice in
reading data from a file. To catch multiple exceptions from a single statement. |
Background: |
In this application, you will practice input and output to a file. In this case, you are writing a preprocessor which will run through a file and create a new file that has only those lines from the file that meet the criteria for the file. The lines of the file should be of the form of 3 integers separated by commas. Each line will end with a new line character. If the line contains 3 valid integers, you will write the entire liine out to an output file by the name of userNamegood.txt. If the line contains anything other than 3 valid integers, you should display the entire line and write the line to a file userNamebad.txt. |
Terms: |
Delimiter
- A symbol used to separate tokens in an input stream. Charset - A set of characters to use in interpreting file characters.See Charset class. |
Materials: |
Testing file: tester.txt Stub: FilePreprocess.java
|
Acknowledgment |
Save your Phase I file as FileProcessV1.java.
Instead of printing the error lines to the error output, you should send it to an error file.
Updated 02/13/2014 (nlh/jah)