statistics script for counting the result of more csv files 2

statistics script for counting the result of more csv files (revision1)


resultFile="./result.txt"

filepath="./scenario_name_uniq_2.txt"
`cat ./*.csv > name.txt`
`awk -F "-" '{print $1,$NF}' name.txt > name1.txt`
`awk '{print $1,$NF}' name1.txt > name2.txt`

`sort name2.txt | uniq > scenario_name_uniq.txt`
`awk '{print $1}' scenario_name_uniq.txt > scenario_name_uniq_2.txt`

`sed -i 's/\[/\\\[/g' scenario_name_uniq_2.txt`
sleep 1
`sed -i 's/\]/\\\]/g' scenario_name_uniq_2.txt`
sleep 1

if [-f "$resultFile"];then
  `rm result.txt`
fi

while read LINE
do
     scenario_name=`echo $LINE |cut -d " " -f 1`
     echo "scenario_name:"$scenario_name
     scenario_name1=`echo "$scenario_name" |sed 's/\[/\\\[/g'`
     echo "scenario_name1:"$scenario_name1
     scenario_name2=`echo "$scenario_name1" |sed 's/\]/\\\]/g'`
     echo "scenario_name2:"$scenario_name2
     variable=" OK"
     scenario_name_new=${scenario_name2}${variable}
     echo "scenario_name_new:"$scenario_name_new
     command="awk '/^$scenario_name_new$/' name2.txt | wc -l"
     echo $command
     size=`eval $command`
     echo "size:" $size
     `echo $size:pass scenario_name:$scenario_name >> result.txt`
done < $filepath

`rm name*.txt`
`rm scenario*.txt`

`sort result.txt | uniq > finalResult.txt`
`rm result.txt`
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值