I have a need to concatenate lines matching a pattern to be concatenated with the preceding line.
Example:
INPUT
Description: Process STORE.EXE (PID=3364).
(Server name | Roles | Enabled | Reachability.........
In-site:
servername1.local CDG 1 7 6 1 0 1 1 1 2
servername2.local CDG 1 7 7 1 0 1 1 7 1
OUTPUT
Description: Process STORE.EXE (PID=3364). (Server name | Roles | Enabled | Reachability.........
In-site:servername1.local CDG 1 7 6 1 0 1 1 1 2 servername2.local CDG 1 7 7 1 0 1 1 7 1
The issue I have is that the PID=3364 varies; the CDG value varies and not all lines starting with, "Description", end with a PID.
However any line starting with Servername 2.local CDG should be concatenated with the previous line.
And, and line beginning with, "(Server name" should be concatenated with the previous line.
I have thousands of these records so doing it manually is out of the question
concatenate to previous line
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard