import java.io.File; import java.io.FileReader; import java.io.LineNumberReader; public class Main { public static void main(String[] args) throws Exception { File file = new File("data.csv"); FileReader fr = new FileReader(file); LineNumberReader lnr = new LineNumberReader(fr); // lnr.setLineNumber(400); String line = ""; while ((line = lnr.readLine()) != null) { System.out.println("Line Number " + lnr.getLineNumber() + ": " + line); } fr.close(); lnr.close(); } }