Isn't this where you started? Why do you insist on using >> when everyone here, and your own experiments, tell you it doesn't do what you want? You may believe that >> stops at commas, but it does not. Again, to read up to the comma, use getline -- as you have it in your program! --
Originally Posted by Coding
et cetera. Note as well that getline finds the comma and throws it away for you.
getline(Main, Action, ',');
getline(Main, BDate, ',');
Todd's idea is simpler, but will only find the last part of the line. If you will never need Action and Date and all the rest, then there's no reason to try to read them. If you do need them, or will in the future, then you'll have to parse through the line as above.