The idea is to make a long line out of the 3 lines with fields separated by colons (
and to cut the interesting fields
to replace a string by another:
To append next line to the buffer:
to create a label:
to jump to a label if previous command was successful:
to get more informations on sed commands:
First, we put a label to jump to later on (we call the label "a": -e :a
Next, we replace "tag info for" with a colon ":" so as to isolate the actual information in a field: s/tag info for /:/g
Next, we replace long sequences of spaces with a colon to separate fields: 's/ */:/g'
Next, wa append the next line to the buffer: -e N
Next, we replace the new line with a colon to separate lines: -e 's/\n/:/'
Finally, we jump to the label we created earlire in order to process other lines (if there are): -e ta
Now we have a line with many fields separated by colons. We just have to extract the interesting ones with cut:
cut -f2,6,8,16 -d: --output-delimiter=" |"