reading and using Comma Separated Values

I have a csv file and want to read and use the data. So far I've been able to load the data into my program and put it into vectors although currently my program does not produce any output. FYI, I have a date/time columns, double column, int column and a float column.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <string>
#include <sstream>
#include <vector>
#include <fstream>

int main()
{
    std::ifstream theFile ("example.csv");
    
    // ............
    
    std::string line;
    std::vector<std::vector<std::string> > values;

    while(std::getline(theFile, line))
    {
        std::string line_value;
        std::vector<std::string> line_values;
        std::stringstream ss(line);
        while(std::getline(ss, line_value, ';'))
        {
            line_values.push_back(line_value);
        }
        values.emplace_back(line_values);
    }
    
    return 0;
}


I want to use the data in a menu program that (a) print in ascending order, (b) prints in descending order and (c) exit. I am stuck and have no idea how to from here. Any help will do.

Also, my columns have headings, how do I let my program know to disregard them? Thanks!
Topic archived. No new replies allowed.