Hi guys,
I am currently exporting data from an excel import using excel interop. I've been fiddling with this for a few hours now, but can't get the export as I desire.
I'm taking a range of 2 columns and about 1k rows from an excel doc, and simply want to add a comma to the end of each column, but because of the way that I'm looping through the range values, I can't seem to get my head around it. Anyway, here's the code:
for (long colCounter = 1; colCounter <= iCols; colCounter++)
{
for (long rowCounter = 1; rowCounter <= iRows; rowCounter++)
{
//Write the next value into the string.
valueString =
valueString.ConcatImport(Convert.ToString(saRet[rowCounter, colCounter]), "\n");
}
}
I think I need to add another loop somewhere to check if I'm at a new column or not, and then add the comma value on. Similar to how its implemented for new lines in each row, but I just can't seem to get there!
Thanks for any help!