I have a file with data as below
Your example data can be almost transformed as requested like:
sed 's/<[^>]*>//g' <infile >outfile
There is that last trailing
| pipe thing on the line6 line. Because your example is apparently a screen shot I'm thinking it is actually your cursor in freeze-frame.
I'm uncertain if it is a mistake or if it is meant to represent an outlier, but, either way, this doesn't handle it. I could make it so, but I would need some clarification on that score.
However, if that's as difficult as it gets, then it will work.
sed 's/.*\(line[0-9]*\).*/\1/' file > new_file
<start>line1<end> line2 line3<end> <start>line4 line123 <start>line12<> <>line<end> <start>line456
line1 line2 line3 line4 line123 line12 line line456
It will extract for your any line[digit] from any string