I don’t remember how to get strings from a textfile.txt
I just have a two commands and then the name of the info
I = Insert
D = Delete
Example:
I Blue
I Red
D Blue
I Green
D Red
D Green
So one would be String command and the other String info
Any help??
EDIT:
I forgot to mention it tells me to prompt the user to specify the name of the input file
This is a little primitive but it works. It uses
Scannerclass andStringTokenizer. Of course, there could be many other ways to do it.EDIT: It was tested for the following data: