print lines form nth line to mth line which fulfill specific condition
Dear all,
I have a file like: Code:
bala-bala The part in middle with Code:
What I want to do is to print the irregular part as its orignal format and print the middle regular part from the 107th to 211th line of this part. Please notice that the 107th line is not the 107th line of the whole file but the 107th line just of the middle regular part. The same for 211th line. In this case, the line of "OP1 C B 116 -47.050" would be the first line, then "OP2 U B 116 -44.778" is the second line, and so on. The output file should look like: Code:
bala-bala |
So the 107 and 211 part made no sense to me :( Also you need to explain how you converted the lines as they are quite radically different from the input file?
|
Quote:
Code:
OP1 C B 116 -47.050 I suppose the No.107 line in the middle part would be Code:
OX1 T B 180 -40.190 Code:
XC1 M B 104 -40.989 |
Quote:
I have a input file: Code:
bala-bala Code:
OP2 U B 116 -44.778 Code:
O4' C B 116 -47.664 The output file should be: Code:
bala-bala |
Yes I think I follow now. So print as normal until you find start of middle and then increment a counter till you get to 107 and then print until you get to 211 then wait till
you find the end of middle portion and start printing the rest. |
All times are GMT -5. The time now is 03:15 AM. |