Joining Textlines containing "Key: Text."

Zimmermann berndmz at unido.UUCP
Fri Nov 8 00:36:15 AEST 1985


I have a file where each line contains a keyword, a colon and text. The keyword
would be a string not containing a colon and the file is sorted by key.
I want to join lines with the same key so that the key and the colon appears
only once and the text potions are concatenated somehow.


key1 : textA				key1 : textA
key2 : textB		     \		key2 : textB textC textD
key2 : textC		======\		key3 : textE textF
key2 : textD		======/
key3 : textE		     /
key3 : textF

I think this problem isn't so exotic. E.g. it may occur when you generate
makefiles automatically.



More information about the Comp.unix mailing list