I have a repetition starting at row zzz in a text file.zzz ***Wed Aug 16 06:00:30 UTC 2017MemTotal:       195702024 kBMemFree:         1323524 kB..Cached:         58020288 kB..other rowszzz ***Wed Aug 16 06:01:00 UTC 2017MemTotal:       195702024 kBMemFree:         1379588 kB..other rowsCached:         58001952 kB..other rowsI want to sum up the values of MemFree: and Cached: for each repetition.There are 3 columns on such lines. KB being the third column.For eg: MemFree:         1323524 kB + Cached:         58020288 kB = 59343812 MemFree:         1379588 kB + Cached:         58001952 kB = 59381540Want an output like:Total Available Memory = 59343812Total Available Memory = 59381540......
Awk command for summing 2 patterns in pairs from a text file
linux;text processing;awk;sed