Originally posted as a Categorized Question.
In reply to How to (conditionally) modify the previous line based on contents of current line? by polr