I have a .txt file containing lines like:
ZAN ZAN name = AI_EVENT desc (further text)
ZAN ZAN name = AI_EVENT desc ...
ZAN ZAN1 name = AI_EVENT desc ...
ZAN ZAN1 name = AI_EVENT desc ...
WUR WUR name = AI_EVENT desc ...
WUR WUR name = AI_EVENT desc ...
VEN VEN name = AI_EVENT desc ...
VEN VEN name = AI_EVENT desc ...
VEN VEN1 name = AI_EVENT desc ...
VEN VEN1 name = AI_EVENT desc ...
VEN VEN2 name = AI_EVENT desc ...
VEN VEN2 name = AI_EVENT desc ...
etc (more lines sorted in a reverse alphabetical order)
I am seeking to join the lines which start with the same three letter combination, how would I go about doing this? I only have limited experience with SED and I cannot figure out a way to get this done.