using System;
using System.Linq;
public class Test
{
public static void Main()
{
var s = new string[] {
"a0|a1|a2|a3|a4|a5|a6|a7|a8|a9|a10|a11|a12",
"b0|b1|b2|b3|b4|b5|b6|b7|b8|b9|b10|b11|b12"
};
var result = s.Select(a => a.Split(new[] { '|' }, StringSplitOptions.None))
.Select(a => new {
Column1 = a[2].Trim(),
Column2 = a[5].Trim(),
Column3 = a[6].Trim(),
Column4 = a[11].Trim()
});
foreach (var entry in result)
Console.WriteLine(entry.Column1 + ", " + entry.Column2 + ", "
+ entry.Column3 + ", " + entry.Column4);
}
}
dXNpbmcgU3lzdGVtOwp1c2luZyBTeXN0ZW0uTGlucTsKCnB1YmxpYyBjbGFzcyBUZXN0CnsKCXB1YmxpYyBzdGF0aWMgdm9pZCBNYWluKCkKCXsKCQl2YXIgcyA9IG5ldyBzdHJpbmdbXSB7CiAgICAgICAgICAgICJhMHxhMXxhMnxhM3xhNHxhNXxhNnxhN3xhOHxhOXxhMTB8YTExfGExMiIsCiAgICAgICAgICAgICJiMHxiMXxiMnxiM3xiNHxiNXxiNnxiN3xiOHxiOXxiMTB8YjExfGIxMiIKICAgICAgICB9OwoKICAgICAgICB2YXIgcmVzdWx0ID0gcy5TZWxlY3QoYSA9PiBhLlNwbGl0KG5ld1tdIHsgJ3wnIH0sIFN0cmluZ1NwbGl0T3B0aW9ucy5Ob25lKSkKICAgICAgICAgICAgLlNlbGVjdChhID0+IG5ldyB7CiAgICAgICAgICAgICAgICBDb2x1bW4xID0gYVsyXS5UcmltKCksCiAgICAgICAgICAgICAgICBDb2x1bW4yID0gYVs1XS5UcmltKCksCiAgICAgICAgICAgICAgICBDb2x1bW4zID0gYVs2XS5UcmltKCksCiAgICAgICAgICAgICAgICBDb2x1bW40ID0gYVsxMV0uVHJpbSgpCiAgICAgICAgfSk7CiAgICAgICAgZm9yZWFjaCAodmFyIGVudHJ5IGluIHJlc3VsdCkKICAgICAgICAgICAgQ29uc29sZS5Xcml0ZUxpbmUoZW50cnkuQ29sdW1uMSArICIsICIgKyBlbnRyeS5Db2x1bW4yICsgIiwgIgogICAgICAgICAgICAgICAgICsgZW50cnkuQ29sdW1uMyArICIsICIgKyBlbnRyeS5Db2x1bW40KTsKCX0KfQ==