File Reader that can read line by line contents

Hi there!

I would like to ask how to read the content of a file line by line... I need to convert all the contents of a text file into html file.

Example:

3890001604AM0 - With Shipping Order DT Actual Transactions ... Joji to provide GMUS.

3890003011NZ0 - With Shipping Order DT Actual Transactions ... Joji to provide GMUS.

3890003012NZ0 - With Shipping Order DT Actual Transactions ... Joji to provide GMUS.

3890003014NZ0 - With Shipping Order DT Actual Transactions ... Joji to provide GMUS.

I need to insert
tag after the last character of every line or enclose each line with <LI></LI> tag.

Result

3890001604AM0 - With Shipping Order DT Actual Transactions ... Joji to provide GMUS.

3890003011NZ0 - With Shipping Order DT Actual Transactions ... Joji to provide GMUS.

3890003012NZ0 - With Shipping Order DT Actual Transactions ... Joji to provide GMUS.

3890003014NZ0 - With Shipping Order DT Actual Transactions ... Joji to provide GMUS.

OR

<LI>3890001604AM0 - With Shipping Order DT Actual Transactions ... Joji to provide GMUS.</LI>

<LI>3890003011NZ0 - With Shipping Order DT Actual Transactions ... Joji to provide GMUS.</LI>

<LI>3890003012NZ0 - With Shipping Order DT Actual Transactions ... Joji to provide GMUS.</LI>

<LI>3890003014NZ0 - With Shipping Order DT Actual Transactions ... Joji to provide GMUS.</LI>

How can I do this in java? I am currently using the FileReader class but It seemed that it reads character by character and I am having a hard time in inserting the
tag or enclosing each line with <LI> and </LI> tags.

Anyone who got some ideas in dealing with this problem?

Thank you and God bless.

[1863 byte] By [khickyphutza] at [2007-11-26 22:23:21]
# 1
Wrap your FileReader into a [url= http://java.sun.com/j2se/1.5.0/docs/api/java/io/BufferedReader.html]BufferedReader[/url].
TimTheEnchantora at 2007-7-10 11:22:39 > top of Java-index,Java Essentials,Java Programming...
# 2
Use a BufferedReader around the FileReader.
quittea at 2007-7-10 11:22:39 > top of Java-index,Java Essentials,Java Programming...
# 3
sorry i cannot picture it out... I am just a beginner in java ahuhuhu I am just forced to learn this language?(I am previously assigned in vb apps)?br>Please help ?
khickyphutza at 2007-7-10 11:22:39 > top of Java-index,Java Essentials,Java Programming...
# 4
Follow the link I posted. It gives an example on how you can wrap a FileReader into a BufferedReader.Then, use BufferedReader's readLine() method, which reads a whole line at once.
TimTheEnchantora at 2007-7-10 11:22:39 > top of Java-index,Java Essentials,Java Programming...
# 5

BufferedReader in = new BufferedReader(new FileReader("..."));

String line = null;

while ((line = in.readLine()) != null) {

/* use line */

}

// close reader

quittea at 2007-7-10 11:22:39 > top of Java-index,Java Essentials,Java Programming...
# 6
Thanx a lot dude?i never thought that BufferedReader can accept FileReader Object?br>I'll try it now.. Thank you and God Bless.MaDz
khickyphutza at 2007-7-10 11:22:39 > top of Java-index,Java Essentials,Java Programming...
# 7
Yaps... It works dude yeeeepeeey.... ?thanks a lot dude hehe.. 1 java burden down again hehe..Thank you so much and God bless always..MaDz
khickyphutza at 2007-7-10 11:22:39 > top of Java-index,Java Essentials,Java Programming...