# 本文是已文件为例子,中文数字组合格式支持两种,如69--->六十九或者六九。大小写可自行替换
#http://blog.csdn.net/xiao0915/article/details/17244841
# 用按字符提取转换,如一百二十四 提取到 1 100 2 10 4,
# ----> 1*100+2*10+4,偶数位必定是能%10==0,
#测试了下,十亿,百亿都可以转
for i in `ls *.txt`
dosum=0
gstr=`echo $i|sed 's%第%第 %'|sed 's%章% 章%'`
fstr=`echo $gstr|awk '{print $2}'|sed 's%亿% 10000 %g'|sed 's%万% 10000 %g'|sed 's%千% 1000 %g'|sed 's%百% 100 %g'|sed 's%十% 10 %g'|sed 's%九% 9 %g'|sed 's%八% 8 %g'|sed 's%七% 7 %g'|sed 's%六% 6 %g'|sed 's%五% 5 %g'|sed 's%四% 4 %g'|sed 's%三% 3 %g'|sed 's%二% 2 %g'|sed 's%一% 1 %g'`
#echo $fstrhstr=`echo $gstr |awk '{print $1}'`
tlstr=`echo $gstr |awk '{print $NF}'`