hello,
i would like to write a better version of the unix `column` with some
options like 'preserve separator' so i started to write it down.
sub padded-cols ($sep,@sheet) {
my $fmt =
join $sep,
@sheet[0].keys.map:
-> $col { "\%-{ [max] @sheet[*;$col].map: *.chars }s" };
@sheet.map: {$fmt.sprintf(|$_)}
}
my $sep = @*ARGS.shift;
.say for padded-cols $sep, $*ARGFILES.lines.map: (*.split($sep)).eager;
now i would like to add options like -mean -max 1:25 and it would be
nice to write a MAIN function to delegate borring stuff to perl6.
i googled, tried to read the doc and grep in roast but i found no way to
do it. any idea to help me. so thanks thanks for reading and helping.
regards
--
Marc Chantreux (eiro on github and freenode)
http://eiro.github.com/
http://eiro.github.com/atom.xml
"Don't believe everything you read on the Internet"
-- Abraham Lincoln