al-eax/CSVWriter

First row issue

mdk19015 opened this issue · 2 comments

I tried to run csv.newRow() << .....
It ran without any problem. Then I tried to save the csv file using csv.writeToFile("foobar.csv", true); It saved file but the first row was blank, every data is saved from the second row.
I need to enter header in the first row and then the data from the second row. How do I do that?

Full Code:

int main()
{	
	float x1 = 100.01;
	float y1 = 150.09;

	CSVWriter csv(",");
	csv.newRow() << "this" << "is" << "the" << "first" << "row" << x1 << y1;
	float x2 = 199.09;
	float y2 = 299.09;
	csv.newRow() << "this" << "is" << "the" << "second" << "row" << x2 << y2;
	std::cout << csv << std::endl;
	csv.writeToFile("foobar.csv", true);

	return 0;
}

TIA.

Could you resolve this issue?

@blankton2 @hiperdyne19015 sorry for my late response
i hope this commit fixes your issues. The issue waw caused by calling writeToFile with true to append data to a non existing file.