I am importing two text files in java, one contains multiple grocery lists and the other contains a list of grocery items that I do not want.
I need to separate the various grocery lists and scan each of them to see if they contain any of the items on the list of things I don't want. If a grocery list contains one or more items on the forbidden list, i need to move this grocery list to a junk folder but the lists that do not contain any of the words must stay. Therefore I need to check each list individually.
I do not know how to separate the grocery lists in order to check them separately. I also do not know how to check the imported forbidden list against the other grocery lists.
Thanks.
The lists are separated by the word "Finish" appearing as the last line on the list. I used a delimiter to and set Finish as my pattern but I don't really know if that worked. I know it separates the lists physically if I output them but I don't know if that has made them separate entities that I can scan separately.