Hi i have this code that reads a this txt file below.
My code:
The File.txt:try { BufferedReader in = new BufferedReader(new FileReader("file.txt")); String str; while ((str = in.readLine()) != null) { System.out.println(str); } in.close(); } catch (IOException e) { }
I would like to edit the code so that it would be more like:Ollie
1
2
3
----
Fred
1
2
3
----
str.equals("Ollie") System.out.println(1); System.out.println(2); System.out.println(3);
i know thats not how you code it but just trying to show that it only reads the 3 lines below the name if the name equals "Ollie"
Thanks in advance
Ollie =]