Is there a easy way to do the following in (Korn) shell?
My text file contains lines similar to the following, each on a different line:
[highlight]Note that n can be any no. and need not be in a sequence.[/highlight]
I want these lines sorted out and [highlight]printed on a single line [/highlight]such that I print the following lines into a file:
reg1.inst_abc[0].a matches with inst_abc[0].a
The no. 'n' on left should match the one on the right side.
It will be of great help if the commands used to achieve this is explained.
Thanks,
RV
My text file contains lines similar to the following, each on a different line:
Code:
# reg1.inst_abc[0].a unmatched
# reg1.inst_abc[1].a unmatched
....
....
.....
# reg1.inst_abc[n].a unmatched
# inst_abc[0].a unmatched
# inst_abc[1].a unmatched
...
...
...
# inst_abc[n].a unmatched
I want these lines sorted out and [highlight]printed on a single line [/highlight]such that I print the following lines into a file:
reg1.inst_abc[0].a matches with inst_abc[0].a
The no. 'n' on left should match the one on the right side.
It will be of great help if the commands used to achieve this is explained.
Thanks,
RV