@gbianchi mira mando el codigo para que veas:
var clientesOrdenados = (from cns in datoscns
join clte in datosclte
on cns.ID_cliente equals clte.ID_cliente
select new
{
Mercado = clte.Mercado,
Nemonico = clte.Nemonico,
Cliente = cns.ID_cliente,
Facturado = cns.Facturado
});
try {
StreamWriter sw = new StreamWriter(@"C:\Users\pc\Desktop\p3\clientesConsumo.txt");
sw.WriteLine($"MERCADO\tNEMONICO\tMAXIMO\tPROMEDIO\tTOTAL");
var agrupado = clientesOrdenados.GroupBy(x => x.Nemonico);
foreach (var clte in agrupado)