Here's what I get from top -l 1 -u -o cpu -n10 | awk 'NR==12, NR==22 {print $2,$3,$8}';:
COMMAND %CPU MEM
WindowServer 0.0 574M+
Google Chrome 1
kernel_task 0.0 1183M+
postbox 0.0 1027M+
Google Chrome 1186+
coreaudiod 0.0 6416K+
Google Chrome 1
Telegram 0.0 364M+
Google Chrome 1
Slack Helper 1
This is a table with rows and column. If you want to format it better you can pipe it into column.
top -l 1 -u -o cpu -n10 | awk 'NR==12, NR==22 {print $2,$3,$8}' | column -t:
COMMAND %CPU MEM
WindowServer 0.0 549M+
Google Chrome 1
kernel_task 0.0 1174M+
postbox 0.0 1027M+
Google Chrome 1185+
coreaudiod 0.0 6416K+
Google Chrome 1
Telegram 0.0 365M+
Google Chrome 1
Slack Helper 1
EDIT: Since top delimits these fields with whitespace there will be problems with parsing out the correct columns. Setting the column via -stats might be better:
top -l 1 -u -o cpu -n10 -stats command,cpu,mem | awk '/COMMAND/{y=1;next}y'
WindowServer 0.0 560M+
Google Chrome He 0.0 402M+
kernel_task 0.0 1170M+
postbox 0.0 1027M+
Google Chrome 0.0 235M+
coreaudiod 0.0 6408K+
Google Chrome He 0.0 161M+
Telegram 0.0 364M+
Google Chrome He 0.0 107M+
Slack Helper (Re 0.0 307M+
top -l 1 -u -o cpu -n10) and the output of said awk command so we can then help you write it. Without sample input/output we're just guessing at what you want to do in your awk script. I can't imagine what you thoughtprintf("%s %10f %8s\n",NR==12, NR==22, $2, $3, $8)would do.