PDA

View Full Version : Stringstream problem



emp1953
4th June 2018, 22:05
I have read a csv text file using std::stringstream iss(line)
I parse each line with std::getline(iss,val,',');
then I put each val into a 2d array named data of type std::string

Using std::stringstream convertor(val);
convertor >> data[x][y];

Each comma separated data item in each line is handled correctly except the first.
it is a date time field from Windows VB6
#2017-07-14 06:15:33#

After going through the convertor line the time does not make it into the data[][] array.

How can I correct this issue? I am using QtCreator and QT4.8.
I could not get this file read with any QFile operations, thus the c++ code. If I need to post the code I can do it, it's just not an easy transfer of text for me.

Thanks for any help
emp1953