5 ms·
The first operation where I split to lines, then join, then split again... was annoying me. So now I've got this say qx< cal -hy >.lines.skip.batch(9) .m
by elcaro 5y ago
The first operation where I split to lines, then join, then split again... was annoying me. So now I've got this
say qx< cal -hy >.lines.skip.batch(9)
.map({ |([Z] .join.comb(22).batch(3)) })
.map({ |(.[2] ~ .[0].trim, |.[3 .. *]) })
.grep(*.trim.chars).join("\n")
.subst(/\s+ ^^ \s\s+ 1»/, ' 1', :g)