In vim, running this will delete everything before SUBSTR.

%s/^.*\(SUBSTR\)/\1/

Explained:

  1. %s runs the substitute command
  2. ^ matches start of the line
  3. .* matches anything
  4. \(SUBSTR\) matches literal “SUBSTR” and the parentheses around it captures the match
  5. \1 replaces everything matched before with the captured match (in this case, SUBSTR)