Dynamic calculation
Hi Experts,
please see below are the dynamic text files.
abc,445,hhh,data,10,country,data,88,city
abc,445,hhh,data,10,country,data,88,city
abc,445,hhh,data,10,country,data,88,city
abc,445,hhh,data,10,country,data,200,city
abc,445,hhh,data,10,country,data,88,city,games,100,data,20,basket
abc,445,hhh,data,10,country,data,88,city,games,100,data,20,basket
abc,445,hhh,data,10,country,data,88,city,games,100,data,220,basket
I need a shell script which can show me those lines which is having data greater than 200.
for example in the below line
abc,445,hhh,data,10,country,data,88,city
script should add the data value like 10+88=98 and if the value is greater than 200 it should print the whole line like
abc,445,hhh,data,10,country,data,88,city,games,100,data,220,basket
data =10+88+220 is greater than 200 so it should print the whole line.
Note the data value is dynamic it can appera many times in the file.
Thanks