日期:2014-05-16 浏览次数:20654 次
#1.txt
1,0,b831e71b782a1e06e4e5f24e84680fb6,cjd_live_vl_0.0.0.0,河北,网通,11.3,20140103
2,1,116,1393832677,1393834199,1522
2,1,144,1393834575,1393835102,527
3,1,1393848426,1393851786,3360
#要求效果
1,0,b831e71b782a1e06e4e5f24e84680fb6,cjd_live_vl_0.0.0.0,河北,网通,11.3,20140103,,b831e71b782a1e06e4e5f24e84680fb6
2,1,116,1393832677,1393834199,1522,b831e71b782a1e06e4e5f24e84680fb6
2,1,144,1393834575,1393835102,527,b831e71b782a1e06e4e5f24e84680fb6
3,1,1393848426,1393851786,3360,b831e71b782a1e06e4e5f24e84680fb6
for i in `find . -type f -name "*.txt"`; do
echo Handling $i
str=`awk -F, 'NR==1{print $3}' $i`
sed -i "s/$/,$str/" $i
done