The solution from steeldriver has an advantage: It can work across five lines as well, seven or more works as well too.
In my case: Find the matching line, and replace the two before, the matched, and the two lines after with the first part from the line, and then an empty "List" value instead of the existing.
The Input is abridged, the lines are originally > 2000 long:
Frame 64 (List 213 [(LM 0 0 836 216 112 0.681952 0.260603)])
Frame 65 (List 236 [(LM 0 0 836 216 112 0.680071 0.187739)])
Frame 66 (List 235 [(LM 0 0 836 216 112 0.678168 0.315848)])
Frame 67 (List 98 [(LM 149 129 1456 216 112 0.525970 11.970105)])
Frame 68 (List 217 [(LM 0 4 1084 216 112 0.837058 0.658243)])
Frame 69 (List 212 [(LM 0 0 1084 216 112 0.829624 0.339764)])
Frame 70 (List 218 [(LM 0 0 1084 216 112 0.829624 0.200893)])
Sed command matching line 67 (out of whack values) is:
sed -re ":a; $q; N; s/(Frame .[0-9] ).*(Frame .[0-9] ).*(Frame .[0-9] ).*LM\ [0-9][0-9][0-9].*(Frame .[0-9] ).*(Frame .[0-9] ).*/\1(List 0 \[\]\)\n\2\(List 0 \[\]\)\n\3\(List 0 \[\]\)\n\4\(List 0 \[\]\)\n\5\(List 0 \[\]\)/; 5,${P;D}; ba" transform1.trf > transform2.trf
The sed command matches Frame 67, output is:
Frame 64 (List 213 [(LM 0 0 836 216 112 0.681952 0.260603) <cut>])
Frame 65 (List 0 [])
Frame 66 (List 0 [])
Frame 67 (List 0 [])
Frame 68 (List 0 [])
Frame 69 (List 0 [])
Frame 70 (List 218 [(LM 0 0 1084 216 112 0.829624 0.200893) <cut>])
See here https://trac.ffmpeg.org/ticket/6816 why I searched for this.
I don't have enough reputation to post it as comment, or to up-vote a solution, so I post it this way. Others might be able to use it. So my thanks go to steeldriver.
<LF>
stand for line feed ? That is, whenfax blahblah
is followed by two empty lines add###
to the beginning of the first one of them ? – don_crissti Jun 26 '17 at 22:24