In this article you will learn Read Data From .txt File in Java Language Line by Line. This is very easy Step by Step program is written below.
String str = null;
try
{
BufferedReader in = new BufferedReader(new FileReader(filename));
while ((str = in.readLine()) != null)
{
System.out.println(str+"\n");
}
in.close();
}
catch (Exception e) {
}
Questions & comments
Did this work for you, or did you hit a different error? Ask below and we will help.