In most cases, CSV files are text files with records delimited by commas. However, sometimes these files will come semicolon delimited. (Excel will use semicolon delimiter
You can read the first line
FileReader fileReader = new FileReader(filePath);
BufferedReader bufferedReader = new BufferedReader(fileReader);
String s = bufferedReader.readLine();
String substring = s.substring(s.indexOf(firstColumnName) + 3, s.indexOf(firstColumnName) + 4);
bufferedReader.close();
fileReader.close();
substring.charAt(0);
Then you capture this value
substring.charAt(0)
depending on whether the CSV is comma or semicolon can use the last value