how to count lines in a csv file in java where the file doesn't have ".csv" extension? [on hold]

I want to get file lines count where file is similar to "csv" but it doesn't have ".csv" file extension. I have only filename.

The code i have mentioned here is the function that count file lines of only those files which have name as abc.txt or abc.csv,, but it will not read the file if the extension doesn't have .txt or .csv. That is the code won't the file if file name is only "abc" instead of "abc.csv"

try {

File file =new File(filePath);

FileReader fr = new FileReader(file);

LineNumberReader lnr = new LineNumberReader(fr);...

Read More »

By: StackOverFlow - Thursday, 8 November

Related Posts