I have file with content:
file.txt:
Iteration 1 RAM: +456ms Cache: +142ms (total +417ms) Iteration 2 Spec: +152ms Cache: +149ms (total +413ms) Iter
$ cat tst.awk BEGIN { FS="[: ]+" } /:/ { vals[$1] = vals[$1] OFS $2+0 } END { for (key in vals) print key vals[key] } $ awk -f tst.awk file Cache 142 149 RAM 456 184 149 Searchms 131 188 Spec 152 172