Skip to main content
Shortened code
Source Link
bit
  • 139
  • 2

C# (.NET Core), 181 162162 160 bytes

input.GroupBy((l)=>ll=>l.Split()[0]).ToList().ForEach((g)=>{using(var sw = new StreamWriter(g.Key.Trim('[').Trim(']')+".log")){foreach(var v in g)sw.WriteLine(v);}});

Try it online!Try it online!

C# (Visual C# Interactive Compiler), 179 bytes

i=>i.GroupBy((l)=>{return l.Split(' ')[0];}).ToList().ForEach((g)=>{using(var sw = new StreamWriter(g.Key.Trim(new char[]{'[',']'})+".log")){foreach(var v in g)sw.WriteLine(v);}})

Try it online!

I'm not sure the first solution is code gulf compliant, so the second solution uses a lambda expression.

C# (.NET Core), 181 162 bytes

input.GroupBy((l)=>l.Split()[0]).ToList().ForEach((g)=>{using(var sw = new StreamWriter(g.Key.Trim('[').Trim(']')+".log")){foreach(var v in g)sw.WriteLine(v);}});

Try it online!

C# (Visual C# Interactive Compiler), 179 bytes

i=>i.GroupBy((l)=>{return l.Split(' ')[0];}).ToList().ForEach((g)=>{using(var sw = new StreamWriter(g.Key.Trim(new char[]{'[',']'})+".log")){foreach(var v in g)sw.WriteLine(v);}})

Try it online!

I'm not sure the first solution is code gulf compliant, so the second solution uses a lambda expression.

C# (.NET Core), 181 162 160 bytes

input.GroupBy(l=>l.Split()[0]).ToList().ForEach((g)=>{using(var sw = new StreamWriter(g.Key.Trim('[').Trim(']')+".log")){foreach(var v in g)sw.WriteLine(v);}});

Try it online!

C# (Visual C# Interactive Compiler), 179 bytes

i=>i.GroupBy((l)=>{return l.Split(' ')[0];}).ToList().ForEach((g)=>{using(var sw = new StreamWriter(g.Key.Trim(new char[]{'[',']'})+".log")){foreach(var v in g)sw.WriteLine(v);}})

Try it online!

I'm not sure the first solution is code gulf compliant, so the second solution uses a lambda expression.

Shortened code
Source Link
bit
  • 139
  • 2

C# (.NET Core), 181181 162 bytes

input.GroupBy((l)=>{return l=>l.Split(' ')[0];}[0]).ToList().ForEach((g)=>{using(var sw = new StreamWriter(g.Key.Trim(new char[]{'[',).Trim(']'})+".log")){foreach(var v in g)sw.WriteLine(v);}});

Try it online!Try it online!

C# (Visual C# Interactive Compiler), 179 bytes

i=>i.GroupBy((l)=>{return l.Split(' ')[0];}).ToList().ForEach((g)=>{using(var sw = new StreamWriter(g.Key.Trim(new char[]{'[',']'})+".log")){foreach(var v in g)sw.WriteLine(v);}})

Try it online!

I'm not sure the first solution is code gulf compliant, so the second solution uses a lambda expression.

C# (.NET Core), 181 bytes

input.GroupBy((l)=>{return l.Split(' ')[0];}).ToList().ForEach((g)=>{using(var sw = new StreamWriter(g.Key.Trim(new char[]{'[',']'})+".log")){foreach(var v in g)sw.WriteLine(v);}});

Try it online!

C# (Visual C# Interactive Compiler), 179 bytes

i=>i.GroupBy((l)=>{return l.Split(' ')[0];}).ToList().ForEach((g)=>{using(var sw = new StreamWriter(g.Key.Trim(new char[]{'[',']'})+".log")){foreach(var v in g)sw.WriteLine(v);}})

Try it online!

I'm not sure the first solution is code gulf compliant, so the second solution uses a lambda expression.

C# (.NET Core), 181 162 bytes

input.GroupBy((l)=>l.Split()[0]).ToList().ForEach((g)=>{using(var sw = new StreamWriter(g.Key.Trim('[').Trim(']')+".log")){foreach(var v in g)sw.WriteLine(v);}});

Try it online!

C# (Visual C# Interactive Compiler), 179 bytes

i=>i.GroupBy((l)=>{return l.Split(' ')[0];}).ToList().ForEach((g)=>{using(var sw = new StreamWriter(g.Key.Trim(new char[]{'[',']'})+".log")){foreach(var v in g)sw.WriteLine(v);}})

Try it online!

I'm not sure the first solution is code gulf compliant, so the second solution uses a lambda expression.

Added two links to code on try it online
Source Link
bit
  • 139
  • 2

C#C# (.NET Core), 181 bytes

input.GroupBy((l)=>{return l.Split(' ')[0];}).ToList().ForEach((g)=>{using(var sw = new StreamWriter(g.Key.Trim(new char[]{'[',']'})+".log")){foreach(var v in g)sw.WriteLine(v);}});

Try it online!

C# (Visual C# Interactive Compiler), 179 bytes

i=>i.GroupBy((l)=>{return l.Split(' ')[0];}).ToList().ForEach((g)=>{using(var sw = new StreamWriter(g.Key.Trim(new char[]{'[',']'})+".log")){foreach(var v in g)sw.WriteLine(v);}})
in.GroupBy((l)=>{return l.Split(' ')[0];}).ToList().ForEach((g)=>{using(var sw = new StreamWriter(g.Key.Trim(new char[]{'[',']'})+".log")){foreach(var v in g)sw.WriteLine(v);}}

Try it online!

I'm not sure the first solution is code gulf compliant, so the second solution uses a lambda expression.

C#, 179 bytes

in.GroupBy((l)=>{return l.Split(' ')[0];}).ToList().ForEach((g)=>{using(var sw = new StreamWriter(g.Key.Trim(new char[]{'[',']'})+".log")){foreach(var v in g)sw.WriteLine(v);}}

C# (.NET Core), 181 bytes

input.GroupBy((l)=>{return l.Split(' ')[0];}).ToList().ForEach((g)=>{using(var sw = new StreamWriter(g.Key.Trim(new char[]{'[',']'})+".log")){foreach(var v in g)sw.WriteLine(v);}});

Try it online!

C# (Visual C# Interactive Compiler), 179 bytes

i=>i.GroupBy((l)=>{return l.Split(' ')[0];}).ToList().ForEach((g)=>{using(var sw = new StreamWriter(g.Key.Trim(new char[]{'[',']'})+".log")){foreach(var v in g)sw.WriteLine(v);}})

Try it online!

I'm not sure the first solution is code gulf compliant, so the second solution uses a lambda expression.

Source Link
bit
  • 139
  • 2
Loading