日期:2014-05-16 浏览次数:20717 次
echo $1
echo $2
rm $2
#read line < $1
#while [ -n "$line" ]
while read line
do
#echo "$line"
temp=$(echo "$line"
------解决方案--------------------
cut -d"=" -s -f2)
#echo "temp = $temp"
echo "$line"
------解决方案--------------------
grep "="
if [ $? -eq 0 ]; then
if [ -z "$result" ]; then
result=$temp;
else
echo "$temp is null"
result=$result"
------解决方案--------------------
"$temp
fi
echo "result = $result"
elif [ -n "$result" ]; then
echo "write $result to file $2"
echo $result
------解决方案--------------------
sed 's/[\" ]//g' >>$2
unset result
fi
#read line < $1
done < $1
$ awk 'BEGIN{FS="\""}/= /{v[i++]=$4}END{print "Result File:";for(i=0;i<length(v);i++){if((i+1)%4)printf "%s
------解决方案--------------------
", v[i];else printf "%s\n", v[i]}}' test.txt
Result File:
00E1
------解决方案--------------------
455001131950438
------解决方案--------------------
116193008089
------解决方案--------------------
72DF9D5B
00E1
------解决方案--------------------
455001151010916
------解决方案--------------------