thunderkid
Technical User
This is second part of previous thread. I need help with summarizing the results of data collection
process. The data is as follows:
short 1 1 455 17 8 0
short 1 1 455 20 6 2
short 1 1 455 20 4 2
short 1 1 345 20 4 0
short 1 2 405 17 8 0
short 1 2 220 17 6 2
med 1 1 455 17 8 0
med 1 1 450 20 6 2
med 1 1 425 20 6 0
med 1 1 420 20 4 2
med 1 1 415 20 0 4
med 1 2 410 17 8 0
med 1 2 415 20 6 2
med 1 2 410 20 6 0
med 1 2 350 17 6 0
med 1 2 315 20 4 2
med 1 2 310 20 2 2
I am trying to compute the sum of values in
col 7 for short and med data set. I would also like to
count the number of times col 5 changes to "20" for
short and med data sets.
Desired format:
sh/med col_2 squirt solv
short 1 1 6
med 1 3 14
I have tried the following, but having
problems debugging:
{for (i=1; $1 = first; $2 = second);
solv = solv + $7;
squirt = $5;
i = i + 1;
if ( $1 = first && $2 = second)
squirt = squirt + 1;
else
{ print $1, $2, squirt, solv
}
thanks,
thunderkid
process. The data is as follows:
short 1 1 455 17 8 0
short 1 1 455 20 6 2
short 1 1 455 20 4 2
short 1 1 345 20 4 0
short 1 2 405 17 8 0
short 1 2 220 17 6 2
med 1 1 455 17 8 0
med 1 1 450 20 6 2
med 1 1 425 20 6 0
med 1 1 420 20 4 2
med 1 1 415 20 0 4
med 1 2 410 17 8 0
med 1 2 415 20 6 2
med 1 2 410 20 6 0
med 1 2 350 17 6 0
med 1 2 315 20 4 2
med 1 2 310 20 2 2
I am trying to compute the sum of values in
col 7 for short and med data set. I would also like to
count the number of times col 5 changes to "20" for
short and med data sets.
Desired format:
sh/med col_2 squirt solv
short 1 1 6
med 1 3 14
I have tried the following, but having
problems debugging:
{for (i=1; $1 = first; $2 = second);
solv = solv + $7;
squirt = $5;
i = i + 1;
if ( $1 = first && $2 = second)
squirt = squirt + 1;
else
{ print $1, $2, squirt, solv
}
thanks,
thunderkid