Seems like homework for me but dont want to discourage you.
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
public class demo {
public static void main(String args[]) {
String data = null;
int recCount = 0;
try {
FileReader fr = new FileReader("C:\\Development\\demo.txt");
BufferedReader br = new BufferedReader(fr);
data = new String();
// For the first line thing
data = br.readLine();
if (data != null) {
char[] allCharacters = data.toCharArray();
for (int i = 0; i < allCharacters.length; i++) {
System.out.println(allCharacters[i]);
}
}
// For other lines
while ((data = br.readLine()) != null) {
recCount++; // What is this for ??
System.out.println(data);
}
// This should help you with substring as well
System.out.println(data.substring(26, 53));
}
catch (IOException e) {
System.out.println("IOException error!");
e.printStackTrace();
}
}
}
Hope it helps