void Main()
{
var rowCounter = 2;
var column = 3;
using (var reader = new StringReader("Id,Name,Coord\n1,MyName,\"33.58031909940288,-7.605511124945705\"\n2,TheirName,\"38.89771555435096,-77.03653334423834\""))
using (var csv = new CsvReader(reader, CultureInfo.InvariantCulture))
{
csv.Read();
csv.ReadHeader();
var count = 1;
var result = string.Empty;
while (csv.Read() && count <= rowCounter)
{
if (count == rowCounter)
{
result = csv.GetField<string>(column - 1);
}
count++;
}
result.Dump();
}
}
1条答案
按热度按时间rlcwz9us1#
这是你可以做到的一种方式。