0

I've got a .txt file for a tv-guide that looks like the following. If I choose one of those channels, how can I scan the entire .txt file for all the programs that the channel contains and print them, so I can eventually choose one of its programs and show the information? Thanks in advance!

Nederland 1|Program name 1|News
Nederland 1|Program name 2|Drama
Nederland 1|Program name 3|Soap
Nederland 2|Program name 4|Western
Nederland 2|Program name 5|Docu
Nederland 3|Program name 6|Talk show
Nederland 3|Program name 7|Horror movie
  • 1
    On which step of doing that do you have a concrete *programming* question that would be on-topic here? – Polygnome Jun 18 '16 at 16:11
  • Jelle wants to show he knows that character "|" is not correctly handeled by `split()`. Jelle, per line you write `String[] programProperty = scanner.nextLine().replace("|", ",").split(",");` then use the 3 properties from the array (e.g. `programProperty[0]`) for your `Program` class constructor and put `.print()` at the and if you have a `void print()` in the class. – LowLevel Jun 18 '16 at 16:23

0 Answers0