AWK写报表,分页处理
if [ -s info.unl ]; then
cat info.unl | while read oneline #每次读一行
do
echo $oneline > info_tmp
pglen=`wc -l ${RPT_DIR}/D8407.txt | awk '{print $1}'`
flag=`expr ${pglen} % ${PGLEN} `
if [ $flag -eq 0 ]; then
#写文件尾部
fi
awk -F "|" '{printf(" %-10s %-10s %-16s %-8s %-18s %-8s %-8s %-11s %-37s %-12s %4s %4s\n", $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12)}' info_tmp >> ${RPT_DIR}/D8407.txt
done
fi