Hi,
I have one problem; I must read a html like this;
I read this in a string (correct?) and after I have to do some changes to it and write it on disk but in this way:
There, there's the '\n' because in the original file <body> was in another line of <html>
How can I do this? This my code for read and write:
Thanks
I have one problem; I must read a html like this;
Code:
<html> <body> Hello </body> </html>
Code:
<html>\n<body>\nhello\n</body>\n</body>
How can I do this? This my code for read and write:
Code:
File fin = new File(FILE_NAME);
FileReader in = new FileReader(fin);
istream = new BufferedReader( in );
String line = null;
while ( (line = istream.readLine()) != null ) {
//System.out.println(line);
sb.append(line);
}
// here do changes on the sb
String text = sb.toString();
FileWriter fw = new FileWriter(new File ("out.txt") );
out = new PrintWriter(fw);
out.println(text);
Comment