Not sure how to do this. Simplified things for readability. Actual code does more.
Read column from file. Values are aaa, bbb, ccc.
string[] lines = System.IO.File.ReadAllLines(@"C:\mice\file.csv");
Declare/define string variables.
string aaa = "123"
string bbb = "456"
string ccc = "789"
int counter = 0;
I want to write a loop that reads each column value and prints out its string value.
While (...)
{
Console.WriteLine(lines[counter] + " |" + lines[counter] + "|");
}
But the print out is: aaa |aaa|
Whereas, I want the print out to be: aaa |123
QUESTION: How do I adjust the 2nd part of the WriteLine to print the value of 123 instead of aaa?
Thanks.
ReadAllLinesgives you rows, not columns.