I'm reading from csv file into a list in this way every row in the file is array cell and every cell is a array of columns . this is my reading cod :
public List<string[]> parseCSV(string path)
{
List<string[]> parsedData = new List<string[]>();
string[] fields;
TextFieldParser parser = new TextFieldParser(path);
parser.TextFieldType = FieldType.Delimited;
parser.SetDelimiters(",");
while (!parser.EndOfData)
{
fields = parser.ReadFields();
parsedData.Add(fields);
}
parser.Close();
return parsedData;
}
In the end I got this list of string array . Now I want read specific value from specific cell and specific row from parsedData . how can I do that ?
My problem is that my "row" that I want is a string value , the value that im looking for is from column number 1 and row value of "key".
parseCSV("somePath")[0][0]string Result = parsedData[RowIndex][ColIndex];