I am using getline to read a CSV file.

The line it reads looks something like

"1/24/2010 6:19 1/24/2010 6:59 Merrill - Valley Farms yhy 69 Vegetation 55"

The getline works but, I need to be able to calculate time days between a date the user inputs and the date here. AKA the first few characters in the line. I have tried to use assign and store them to arrays, which works great expect for sometimes the month is 1 or it could be 10, 11 or 12 and then assign does not work correctly.

I have also tried strchr which does not work. My code looks like this, I think the way is to use pointers, I have looked all over and I cannot find a way to do it, especially be able to find the second delimiter.

while (! lineseg.eof() && getline(lineseg,data).good() )
		{
		if( (found=data.find (term[2],0)) !=string::npos && (found=data.find (voltage,0)) !=string::npos)
		{
			
		}}

nevermind

I just added a 0 onto the front of the date I read in and then I will use assign

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.