link如何对一个文件夹下的数据文件排序,报错,Index out of range
List data = new List();
foreach (var file in Dictionary.GetFiles("e:\华新采集", "*.txt"))
{
data.AddRange(File.ReadAllLines(file).Skip(2));
}
var query = data.Select(x => x.Split('\t')).GroupBy(x => x[1]).OrderBy(x => x.Key).Select((x, i) => string.Format("{0}\t{1}\t{2}", i + 1, x.Key, x.Sum(y => int.Parse(y[3]))));
File.WriteAllLines("aaa.txt", query);