Awk cheatsheet

From Lolly's Wiki
Revision as of 11:36, 14 October 2016 by Lollypop (talk | contribs)
Jump to navigationJump to search

Functions

Binary to decimal

function b2d(bin){
  len=length(bin);
  for(i=1;i<=len;i++){
    dec+=substr(bin,i,1)*2^(len-i);
  }
  return dec;
}

Kategorie:AWK