我是大帅哥,擅长LINUX和C语言,还有脚本,希望和大家交朋友 mail:newhitler@163.com

《地区号段输出到XML文件脚本》源代码

上一篇 / 下一篇  2007-12-22 13:39:41 / 个人分类:SHELL编程

#!/bin/bashLUPA开源社区%l:`U:s)XwXb]F

{Rx6i Y#E;|*| ]0declare -i initLUPA开源社区'G#coX1H5A
declare -i count
Q]G5v~k{0declare my_seg_before
g;~Ut(JbU;C;L0declare my_seg_afterLUPA开源社区-N'bN%D6S\\&a0B@
declare my_area
`@"QY_H!g/pqx0
6] |~7VY oe-jL I-e0count=`wc -l 1.txt|awk '{print $1}'`LUPA开源社区#R0T9@#EA
LUPA开源社区q"h[&Wt!Xuj
for seg in 131 130 132 133 153 156LUPA开源社区 Sv vB$kW2yA
  do
j'K#sL}0Q,iBi0    echo "<range type=\"prefix\" value=\"$seg\" region=\"cn.hn\" \
.a,G,?&r#bb,iT+q+P0number_type=\"mobile\" number_len=\"11\">">>temp.txtLUPA开源社区 O|!@"\~A
    for area in zhangjiajie shaoyang yueyang xiangtan yiyang huaihua zhuzhou yongzhou hengyang jishou changde chezhou loudi changshaLUPA开源社区W0R0{!ek9?s
    do
F*pri@In0      echo -n "        <range value=\"">>temp.txtLUPA开源社区7R;y;oe2\\7px.s)[$V
      for ((init=1;init<=count;init++))
d;{[D:ps]0      doLUPA开源社区]!YwB6v;@(nC
        my_area=`cat 1.txt|sed -n "$init"p|awk '{print $1}'`LUPA开源社区c5V0ld$I&B/LZ7k4at*IV:N
        my_seg_before=`cat 1.txt|sed -n "$init"p|awk '{print $2}'|cut -c 1-3`
!Np(WW @#k'P6yq0        my_seg_after=`cat 1.txt|sed -n "$init"p|awk '{print $2}'|cut -c 4-7`LUPA开源社区q5Q.d]3~9Wd Gw9f:G
        if [ "$area" == "$my_area" ] && [ "$seg" == "$my_seg_before" ]; then
;V2Q I-X${-N0          echo -n ";$my_seg_after">>temp.txt
N0M)h*p$@a r P0        fiLUPA开源社区6m.y/[ sI,G]-@
      done
,M%aa'cnZ)Dc0      echo -n "\" region=\"cn.hn.$area\"/>">>temp.txt
MZI,jqT5M0      echo "">>temp.txt
$K)g'} kYGT0?1l0    doneLUPA开源社区#Wrg VqA6~
    echo "    </range>">>temp.txtLUPA开源社区y'J B]Qi"n1U5M#|j*`
done
f?#?"N(W:M0

TAG:

 

评分:0

我来说两句

显示全部

:loveliness: :handshake :victory: :funk: :time: :kiss: :call: :hug: :lol :'( :Q :L ;P :$ :P :o :@ :D :( :)

日历

« 2008-10-16  
   1234
567891011
12131415161718
19202122232425
262728293031 

数据统计

  • 访问量: 19554
  • 日志数: 62
  • 建立时间: 2007-07-22
  • 更新时间: 2008-10-15

RSS订阅

Open Toolbar