Hello guys so I need help on a project that reads from a .csv file into a dynamic 2d array or a vector. The CSV file contains details of a swimming competition where i am supposed to read both names times and distances for different distances and times. Then I am required to sort them using times and distances and a user should be able to search for a race based on distances and it should show him/her the fastest times for a certain distance.
Here is my code which doesn't sort values by time because it is still in string format despite my attempt to convert it to int
My input file looks like this
code.csv
No,Name,DOB,Heat,Distance,Time,Status
1,Person1,1998,1,100m,0.59,Q
2,Person2,1998,4,200m,1.54,DQ
3,Person3,1999,3,400m,4.32,Q
4,Person4,1997,2,100m,0.52,Q
Expected output
When user selects 100m it should print out names of people who swam the 100m in order of time and status
No,Name,DOB,Heat,Distance,Time,Status
1,Person4,1997,2,100m,0.52,Q
2,Person1,1998,1,100m,0.59,Q