Script to get Row Count of ZIP Files

Hi,
I have some data files in a zipped format.(eg: aa.gz).I would like to know the number or rows in each zip file(May be populate the file name and line numbers into a text file).I know the commands wc -l and gunzip,.But how I will create a shell script for this to extract each files and get row count?I am using ksh.

Thanks,

An example how it could look like:

#!/usr/bin/ksh

IN_DIR=./tmp
OUTFILE=infofile

ls -1 ${IN_DIR} |\
while read LINE; do
        ROW_COUNT=`zcat ${IN_DIR}/${LINE}| wc -l`
        printf "%-10s%s\n" "${ROW_COUNT}" "${LINE}" >> ${OUTFILE}
done

exit 0

I modified slightly.It prints.But for the rowcount, it is giving as 0 always.Any inputs?

#!/usr/bin/ksh
OUTFILE=infofile
cd /home/XYZ/ASH/;
for i in /home/XYZ/ASH/*.gz ;
do
ROW_COUNT=`zcat /home/XYZ/ASH/$i| wc -l`
        printf "%-10s%s\n" "${ROW_COUNT}" "$i" >> $OUTFILE
done

exit 0

yup....

 
#!/usr/bin/ksh
OUTFILE=infofile
cd /home/XYZ/ASH/
for i in *.gz 
do
ROW_COUNT=`zcat /home/XYZ/ASH/$i| wc -l`
printf "%-10s%s\n" "${ROW_COUNT}" "$i" >> $OUTFILE
done
 
exit 0

'ls' is useless here. Also you don't need a trailing ';'

#!/usr/bin/ksh
OUTFILE=infofile

for i in /home/XYZ/ASH/*.gz
do
   ROW_COUNT=$(zcat "${i}" | wc -l)
   printf "%-10s%s\n" "${ROW_COUNT}" "$i" >> $OUTFILE
done

Thanks vgersh.I don't know why it still prints the count as 0 only for all the files.