unix array

Hi ,
suppose , i have a array variable with size 40 and i have assign a 10 character values. I want to print the array like ,the 10 caharacter value with rest 30 character as blank, if i assigned any blank values also .it will print 40 blank space.
Please help me regaring this.It is very urgent .

Thanks in advance

:b:

Look into the command "printf".

it is not working properly .

Show your script inside code tags so we don't have to guess, please.

Hi below is the code :

INFILE="/home2/prax/prac30/c2t/input.txt"
OUTFILE="/home2/prax/prac30/c2t/cage_output.txt"
while read line
do
STCODE=`echo $line | awk -F , '{print $1 }' `
ZIP=`echo $line | awk -F , '{print $2 }' | `
CMKTNM=`echo $line | awk -F , '{print $3 }' `
CMKTCD=`echo $line | awk -F , '{print $4 }'`
CSCTNM=`echo $line | awk -F , '{print $5 }' `
CSCTCD=`echo $line | awk -F , '{print $6 }' `
TLGMKTNM=`echo $line | awk -F , '{print $7 }'`
TLGMKTCD=`echo $line | awk -F , '{print $8 }'`
TLGSMKTNM=`echo $line | awk -F , '{print $9 }'`
TLGSMKTCD=`echo $line | awk -F , '{print $10 }'`
if [ -z $CMKTNM ]
then
echo $line | awk -F , '{printf $1 $2 $7 $8 }'
fi
done < ${INFILE}

Is there any use of all those variables you fill with values? If not maybe just post a snippet of your input file and an example of the desired output. At first glance there is a lot which might be easily simplified.
Use code tags like I implemented them in your former post. Check your old post in edit-mode so you see what I mean.