Calculating Average from a CSV File

后端 未结 4 1604
感动是毒
感动是毒 2021-01-21 23:35

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,

4条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-22 00:28

    Skip the first line of the CSV file. Do an additional

    br.readLine()
    

    before the while.

    You might also want to add some format checks to be sure the file you are reading is in the correct format.

提交回复
热议问题