Gurus,
I need to join lines of a file based on a condition. If line 1 contains a line that ends with a ":" and the following line begins with the string "Average", then I want to join those 2 lines. If the line that ends with ":" is not followed by a line that begins with the string "Average", then I do not wnat to print that line.
My input file contains:
serverabc:
Average 5 4 3 87
hostdef:
Average 3 2 1 93
systemghi:
nodejkl:
Average 6 5 5 83
I need the output to be:
serverabc:Average 5 4 3 87
hostdef:Average 3 2 1 93
nodejkl:Average 6 5 5 83
Thanks,
CSTORM
I need to join lines of a file based on a condition. If line 1 contains a line that ends with a ":" and the following line begins with the string "Average", then I want to join those 2 lines. If the line that ends with ":" is not followed by a line that begins with the string "Average", then I do not wnat to print that line.
My input file contains:
serverabc:
Average 5 4 3 87
hostdef:
Average 3 2 1 93
systemghi:
nodejkl:
Average 6 5 5 83
I need the output to be:
serverabc:Average 5 4 3 87
hostdef:Average 3 2 1 93
nodejkl:Average 6 5 5 83
Thanks,
CSTORM