One of the awk column spilling on the new line from beginning

I am having a problem where the Compute field/column is spilling over to the new line. Here's the piece of code and the o/p:-

Code Sniplet:-

for id in `qstat -u "*" -q "$Queue" -s r |sed -n '3,$ p'|awk -F" " '{print $1}'`
do
NODELIST=`cat /scratch/$id.hostlist.*|awk -F" " '{print $1,$2}'|tr ' ' '*'|sed ':a;N;$!ba;s/\n/,/g'`
NODES=`cat /scratch/$id.hostlist.*|awk -F" " '{print $1}'|wc -l`
echo -ne "$id $NODES $NODELIST\n" >> "$TMPFILE2"
done
cat "$TMPFILE2"|awk -F" " 'BEGIN { printf "%-15s %-15s %s\n","JOBID","NDS","COMPUTE"
printf "%-15s %-15s %s\n","-----","-----","-----"}
{ printf "%-15s %-15s  %s\n",$1,$2,$3 }' 

output:-

JOBID NDS COMPUTE
----- ----- -----
4884 32 n264*1,n246*1,n263*1,n270*1,n269*1,n249*1,n258*1,n242*1,n271*1,n383*1,n151*1,n156*1,n160*1,n161*1,n1 62*1,163*1,n164*1,n165*1,n166*1,n167*1,n168*1,n173*1,n385*1,n377*1,n183*1,n184*1,n185*1,n189*1,n192* 1,n194*1,n195*1,n196*1
5034 2 n305*4,n308*4

Expected o/p :- Want to align Compute node data which are spilling onto new line and are beginning from start
output:-

JOBID NDS COMPUTE
----- ----- -----
4884 32 n264*1,n246*1,n263*1,n270*1,n269*1,n249*1,n258*1,n242*1,n271*1,n383*1,n151*1,n156*1,n160*1,n161*1,n1
            62*1,163*1,n164*1,n165*1,n166*1,n167*1,n168*1,n173*1,n385*1,n377*1,n183*1,n184*1,n185*1,n189*1,n192* 1,n194*1,n195*1,n196*1

This probably is a terminal artefact. What be your COLUMNS value? Try printing to a file and view that with an editor or a pager.

If you really want awk print the $3 value in a second line, you need to split it, and print the second part in a second printf statement with two empty dummies in front.

Hello RudiC, sorry I think I got you a bit confused with my question. Here's the o/p which I am currently getting.

I want my third column(Compute) where lines are long and are spilling to next line and beginning from the start of next line to be indented to the compute column. I guess this is something to do with formatting of the third column. I just wanted to know if there is any possibility to make this happen via awk.

Did you read/understand my second paragraph?

RudiC, I have tried with the split function in awk and I think I am getting the desired o/p. With just some fine tuning I will be able to get the exact output. Thank you very much.

You can split it, or you can use the substr function.