perl -e '$\=$/;$,=" ";@d=@a=sort{lc$a cmp lc$b}@ARGV;for(0..$#a){if($a +[$_]=~/(\d+)/){$b{$1}=$_;push@c,$_}} for(sort{$a<=>$b}keys%b){$d[shif +t@c]=$a[$b{$_}]}print@d' 1 A amstelveen Amsterdam Amsterdam5 Amsterda +m40 Amsterdamned
In reply to Re: A new golf challenge - Natural Sorting
by smokemachine
in thread A new golf challenge - Natural Sorting
by theroninwins
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |