Created
March 20, 2018 19:25
-
-
Save keck/82f5c4658b33da4ba4afa3da28d33260 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aless(){ perl -e 'BEGIN{$D='\t';$f=shift;%cs=();} open(IN,"<",$f); while(<IN>){$c=0; map{ $s=length;$cs{$c}=($s>$cs{$c})?$s:$cs{$c};$c++;}split /$D/;}END{$cs{0}++;$x=join ",",map{($_>0)?($cs{$_}=$cs{$_}+$cs{$_-1}+1):$cs{$_}; $cs{$_}} sort{$a<=>$b}keys %cs;system("less -S -x$x $f");}' $1; } | |
export -f aless | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment