I have a CSV file, format as follows:
City,Job,Salary
Delhi,Doctors,500
Delhi,Lawyers,400
Delhi,Plumbers,100
London,Doctors,800
London,Lawyers,700
London,Plumbers,
br.readLine() before the while-loop will avoid header line problem, but if your data is not correct you will get same Exception again, so, in order to make a safer method you can change this line:
int sal=Integer.parseInt(country[2]);
With a try-catch block to iterate through entire file even if a value is not a valid number
int sal;
try {
sal=Integer.parseInt(country[2]);
} catch (NumberFormatException e) {
// if you want here you can show an error message
// to give feedback to the user there is not a valid number
}