On Monday, 1 August 2022 at 07:35:34 UTC, Christian Köstlin wrote:

An arguably shorter solution (that drops some of your logging) could be:

```d
import std;

void main() {
    dirEntries(".", "*.json", SpanMode.shallow)
        .filter!(f => !f.name.canFind("output"))
        .map!(readText)
        .map!(parseJSON)
.fold!((result, json) { result ~= json.array; return result; })
        .toPrettyString
        .reverseArgs!(std.file.write)("output-combined.json");
}
```
not sure if you are looking for this style though.


kind regards,
Christian


Hi Christian,

So we can do that in D?!
Thanks for sharing this amazing approach.

-ikelaiah

Reply via email to