Hey There,
All credit to the guy who wrote this function to convert decimal to binary (included in the snippet below), but you could use awk to do this and apply this function to the 2nd and 3rd fields in each line/record ($2 $3)
Hope this helps - let me know if you have any difficulty incorporating it into what you've already got going and, if possible, post what you have and let me know where you're having the issue.
Best wishes
, Mike
# The scripts were written to be usefull in
# a research enviornment, but anyone is welcome
# to use them. Happy awking. -Tim Sherwood
func get01string(innum, t, retstr, i) {
retstr = "";
t=innum;
while( t )
{
if ( t%2==0 ) {
retstr = "0" retstr;
} else {
retstr = "1" retstr;
}
t = int(t/2);
}
return retstr;
}
{
print get01string( $1 );
}