For files, the following will let you read each line:
import java.io.FileNotFoundException;
import java.util.Scanner;
import java.io.File;
public static void readText throws FileNotFoundException(){
Scanner scan = new Scanner(new File("filename.txt"));
while(scan.hasNextLine()){
String line = scan.nextLine();
}
}