can anyone please let me know how can i use following gawk command in c ? like we use some shell commands inside c using "system" function. further i want to give the number in below command ie 6,2,8 as parameters.
gawk -v FIELDWIDTHS='6 2 8' 'NR!=1 && x==$1{printf(" %d:%d",strtonum("0x"$2),strtonum("0x"$3)); next}; {x=$1; printf("%s%s %d:%d", NR==1?"":"\n", $1,strtonum("0x"$2),strtonum("0x"$3))}; END{print ""}' input.txt | sed '/^[0-9a-f]* [0-9:]*$/d' > result.txt
thanks, any help will be greatly appreciated.