Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 27 lines (23 sloc) 411 Bytes
BEGIN{
FS=" "
result=""
}
{
for(i=1;i<NF;i++){
total=0
chr=""
# print "Order:" i " Binary Number:" $i;
split($i,arr,"")
for(j=8;j>0;j--){
subtotal = arr[j]*(2^(8-j));
# print "Binary:"arr[j] " Exponent:" 2^(8-j) " Result:" subtotal;
total += subtotal;
}
chr=sprintf("%c",total)
# print "Total:" total " Character:" chr "\n";
result= result chr;
}
}
END{
print "\n\n" result;
}
You can’t perform that action at this time.