How about let the stream pick commas as your format:
std::istream& comma(std::istream& in)
{
if ((in >> std::ws).peek() == ',')
in.ignore();
else
in.setstate(std::ios_base::failbit);
return in;
}
then you can read commas among your data, just like below:
in >> x >> comma >> y;