Java Utililty Methods Text File Line Count

List of utility methods to do Text File Line Count

Description

The list of methods to do Text File Line Count are organized into topic(s).

Method

intnumberOfLines(File file)
number Of Lines
RandomAccessFile randFile = new RandomAccessFile(file, "r");
long lastRec = randFile.length();
randFile.close();
FileReader fileRead = new FileReader(file);
LineNumberReader lineRead = new LineNumberReader(fileRead);
lineRead.skip(lastRec);
int count = lineRead.getLineNumber() - 1;
fileRead.close();
...