I need to read a large text file of around 5-6 GB line by line using Java.
How can I do this quickly?
You can also use Apache Commons IO:
File file = new File("/home/user/file.txt"); try { List lines = FileUtils.readLines(file); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); }