Issue
I need to print the ASCII value of the given character in awk only.
Below code gives 0
as output:
echo a | awk '{ printf("%d \n",$1); }'
Solution
see the awk manual for ordinal functions you can use. But since you are using awk, you should be on some version of shell, eg bash. so why not use the shell?
$ printf "%d" "'a"
97
Answered By - ghostdog74 Answer Checked By - Gilberto Lyons (WPSolving Admin)