#include <iostream>
#include <string>
#include <algorithm>
#include <sstream>

int main()
{
    std::string file = "\"erica\",\"bosley\",\"bob\",\"david\",\"janice\"";
    
    std::istringstream ss(file);
    std::string token;
    
    std::vector<std::string> names;
    
    while(std::getline(ss, token, ',')) {
        names.push_back(token);
    }
    
    for (unsigned int i = 0; i < names.size(); i++) {
        auto it = std::remove_if(names[i].begin(), names[i].end(), [&] (char c) { return c == '"'; });
        names[i] = std::string(names[i].begin(), it);
    }
    
    for (unsigned int i = 0; i < names.size(); i++) {
        std::cout << "names["<<i<<"]: " << names[i] << std::endl;
    }
}
