Space file in string

Mar 24, 2014 at 6:07pm
Hi,

I have a problem, caught the last line of a file and do the division of the same variables in, date, time and value

but the file contains excess spaces in all lines and the date is coming with cuts, example 24/4/2014 appears 4/4/2014

How can I remove the space in the string without affecting the division of the line?

1
2
3
4
5
6
7
8
9
10
11
if (file)
    {
        std::string line = getLastLine(file);
        
 	std::istringstream iss(line);
        getline(iss, date, ' ');
        getline(iss, time, '\t');
        getline(iss, t); //variavel para temperatura em string
    }
    else {
        std::cout << "error file\n";
Last edited on Mar 26, 2014 at 11:33am
Mar 26, 2014 at 11:34am
Could someone please help me with this problem?
Mar 26, 2014 at 12:12pm
Wake wrote:
example 24/4/2014 appears 4/4/2014
I don't understand?
Mar 27, 2014 at 8:29pm
because of excess spaces in the string, the display did not show the "2"
Mar 27, 2014 at 8:47pm
Where are the excess spaces?
Mar 31, 2014 at 6:58pm
In the file, the script performs the reading of the entire last line, the line splits into 3 variables
Topic archived. No new replies allowed.