If I have the following (sample) text file;
year,2008,2009,2010
income,1000,1500,2000
dividends,100,200,300
net profit,1100,1700,2300
expenses,500,600,500
profit,600,1100,1800
Is there a way in Linq that I can select the expenses for 2010 only?
So far I have the following which gets me all the data;
var data = File.ReadAllLines(fileName)
.Select(
l => {
var split = l.CsvSplit();
return split;
}
);
foreach (var item in data)
Console.WriteLine("{0}: ${1}", item[0], item[1]);