FempoedoBlill
New Member
I am new to programming and just started learning java. I would like to try and open an HTML file and divide it tag-per-tag and content per content.I just learned how to scan using Scanner and then check for hasNext() but I figured out it only checks for spaces.\[code\]Scanner input = new Scanner (new FileReader("simple.html"));while (input.hasNext()){ String content = input.next().toString();System.out.println(content);}\[/code\]The problem is...\[code\]//INPUT<html><head><title>Hello</title></head><body><table border=1>Hello World!</table></body></html>//DESIRED OUTPUT<html><head><title>Hello</title></head><body><table border=1>HelloWorld!</table></body></html>//WHAT MY CODE OUTPUTS<html><head><title>Hello</title></head><body><tableborder=1>HelloWorld!</table></body></html\[/code\]Can anyone help me? I'm stuck.A step by step guide will be appreciated.I've seen some third-party programs that automates such but I would like to learn it the "coding way". Coz I'm trying to self-study programming, specifically Java...Thank you so much!