2018-01-15 for loop for s1 report

offerids="1954,1955"
select concat('"',group_concat(campaign_id separator ' '),'"') from tab_campaign where INSTR(',${offerids},',concat(",",offer_id,",")

for id in {campids} do cat 12offer_old/{id}*all 12offer_new/{id}*all > 12offer_total/{id}_total
done

for file in (ls) do linenum=(lines {file}) echo{file/_total/} : ${linenum} >> ../12offer_sums/allCampidSumConversions
done

for file in (ls) do linenum=(lines {file}) echo "total "{file/total/} : {linenum} >> ../12offer_sums/allCampidSumConversions_s1_total_ok awk '{match(0,/("id":"[^]*?)/,id);match(0,/("s1":"[^"]*?")/,a);x[a[1]]++}END{for(i in x){print id[1],",",i,",",x[i]}}'{file} >> ../12offer_sums/allCampidSumConversions_s1_total_ok
done

for file in (ls) do awk '/"type":"normal"/'{file} >> ../12offer_normal/${file/_total/}_normal
done

for file in (ls) do linenum=(lines ${file})

echo "total " {file/_normal/} :{linenum} >> ../12offer_sums/allCampidSumConversions_s1_normal
awk '{match(0,/("_id":"[^_]*?)_/,id);match(0,/("s1":"[^"]*?")/,a);x[a[1]]++}END{for(i in x){print id[1],",",i,",",x[i]}}' ${file} >> ../12offer_sums/allCampidSumConversions_s1_normal
done

你可能感兴趣的:(2018-01-15 for loop for s1 report)