hello Timo,

> lines()>>.trim-leading.classify(*.split(",").head(2)); say to-json %foo'

which led me to this solution:

    fix () perl6 -e '
        lines.classify(*.split(",").head(2)).pairs.map: {
            .say for .key, |.value.map({ "\t" ~ .key });
        }
    '

    fix () perl6 -e '
        lines\
        .classify( *.split(",").head(2) )
        .pairs
        .map: { .say for .key, |.value.map({ "\t" ~ .key }); }
    '

which is nice to read but hold much more data in memory.
anyway: good point.

regards
marc

Reply via email to