I have file with content:
file.txt:
Iteration 1
RAM: +456ms
Cache: +142ms (total +417ms)
Iteration 2
Spec: +152ms
Cache: +149ms (total +413ms)
Iter
Another Perl, using paragraph mode -00
perl -00 -lnE '
while(/(^\S+):.+?(\d+)/gm ) {push(@{$kv{$1}},$2)}
END { foreach(keys %kv) { print "$_ @{$kv{$_}}" } } '
with inputs
$ cat arya.txt
First launch 1
RAM: +456ms
Cache: +142ms (total +417ms)
First launch 2
Spec: +152ms
Cache: +149ms (total +413ms)
First launch 3
RAM: +184ms
Spec: +172ms
Searchms: +131ms (total +385ms)
First launch 4
RAM: +149ms
Searchms: +188ms
$ perl -00 -lnE ' while(/(^\S+):.+?(\d+)/gm ) {push(@{$kv{$1}},$2)} END { foreach(keys %kv) { print "$_ @{$kv{$_}}" } } ' arya.txt
RAM 456 184 149
Cache 142 149
Searchms 131 188
Spec 152 172
$