I have a problem with a set of data that is causing getline() to collect incomplete strings.
The data is exported as csv from a so called 'cloud' application, blah bloody blah, and it is formatted fine and runs fine if the data file is left alone after export, this data export is a weekly task, so if anyone else exporting it in my abscence decides to view it and then save as csv using excel, then the format it saves in will mess up the program output.
to cover this eventuality how can this be caught programatically? It is like the linefeed is being incorrectly interpreted.
I checked in notepad and no special characters are in the data, i used Word and showed formatting marks, nothing in there except end of line and raised dot symbol for spaces.
The line in the data is
And getline is reading :Test Test, emailaddress@provider.com, sitename, status
the remaining lines are incomplete in a similar way, except some of them pick up the whole second name in the first field and discard the first, like:t, emailaddress@provider.com, sitename, status
line in data is:
getline collects:name1 name2, emailaddress@provider.com, sitename, status
however it is most strange as if i use a second call to getline underneath and a temporary string variable the line is collected fine...name2, emailaddress@provider.com, sitename, status
Prior to saving in excel the data exports with strings surrounded by quotes, i saw these are removed after saving in excel, but i do not really think this is the problem as other source data the program uses uses files exported from a different database application that does not add the quotes in the first place anyway.



LinkBack URL
About LinkBacks



