In vim, running this will delete everything before SUBSTR
.
%s/^.*\(SUBSTR\)/\1/
Explained:
%s
runs thesubstitute
command^
matches start of the line.*
matches anything\(SUBSTR\)
matches literal “SUBSTR” and the parentheses around it captures the match\1
replaces everything matched before with the captured match (in this case,SUBSTR
)