I have a CSV with a large number of rows and 7 columns. I get the data from another source and it is labeled as say Column 1 is first name, 2 is last, 3 is age, 4 is gender, 5 is city.

I need to be able to scan through to column 2 and if their last name is smith then take that row and remove it and write it to another file where all the smiths will be put.

Thanks!

C++ by the way

I think you're going to want to create a custom class/struct to represent the structure of the data then write a custom comparison function.

struct Sample {
  std::string var1, var2, var3, var4, //...etc...
};

void readFileLine() {
}

bool compareBasedOnMember() {
  //...
  //return true/false
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.