-3

All I need to do is take a jagged array and print the values so I can bring it to excel to make graphs. The array is double integer. I have seen alot of posts on doing the opposite but not on bringing it from C# to a text file.

jt4
  • 1

1 Answers1

0

Given: Object[][] myJagged; string outfileName;

StreamWriter sw = new StreamWriter(outfileName);
for(int y = 0; y < myJagged.GetLength(); y++)
{
    for(int x = 0; x < myJagged[y].GetLength(); x++)
        sw.Write(myJagged[y][x].ToString() + ",");
    sw.WriteLine();
}
sw.Close();