using System.Collections.Generic;
using System.Globalization;
using System.Text.RegularExpressions;
public int flashid { get; set; }
public int position {get; set; }
public string value { get; set; }
public static void Main()
var list = new List<record>
new record{ flashid = 450, position = 5, value = "a"},
new record{ flashid = 450, position = 6, value = "b"},
new record{ flashid = 450, position = 7, value = "c"},
new record{ flashid = 450, position = 7, value = "d"},
new record{ flashid = 450, position = 7, value = "e"},
new record{ flashid = 450, position = 8, value = "f"},
new record{ flashid = 450, position = 9, value = "g"}
var extendedList = Enumerable
.GroupJoin(list, n => n, r => r.position, (n, g) => g
.DefaultIfEmpty(new record { flashid = 450, position = n, value = "." }));
var result = extendedList
.Aggregate(Enumerable.Repeat("", 1), (a, c) => a
.Select(d => b + d.value)));
foreach (var r in result)