I everyone. I am at a brick wall. I am attempting to match a pattern that is inconsistant in a large file.
Back ground. This is a circuit report that is generated to a flat file. The report wraps the circuit name to the next line if it goes beyone it's parameters.
Example:
Circuit 12.27 ABC WIRELESS nnn-n |Up |VCC | |
nnn | | | |
ABC1 | |50.1 |12|ON
ABC1 | |50.2 | 3|Off
This is shortened for readability but the beginning is what I am looking at.
In this file all circuits are represented in either 3 or 4 lines.
Circuit Name line is either followed by the rest of circuit name/number or ABC1|ABC2.
What I need is to join second 1/2 of Circuit name on line two to line one circuit name.
The first line always starts at ^
the second line (if wrapped) starts at the fifth space from ^
the third and fourth line (ABC1|ABC2) starts at the second space from ^
or if not wrapped first line starts at ^
second and third start at the seond space from ^
any help would be greatly appreciated.
Thank you
Lost Boy