Skip to main content
1 of 2

it is easy to find files according to times you prefer.but for getting the result of that you could use awk like this:

  awk -F\| '!/^\s*$/{if($4=="S:0"){Arr0[$1","$2","$3]+=1} else {Arr1[$1","$2","$3]+=1}}END{for(i in Arr1){print i,",",Arr0[i],",",Arr1[i]}}'

for explanation:

  1. -F|: define | as field seperator

  2. !/^\s*$/: skip empty lines

  3. if(Clause){Statement}else{statement}: clear

  4. END{...}: this block executes when operator riched to EOF