I would use awk for this task. Roughly:
Code:
/^..ABC/ { ACTION }
where ACTION is based on the sub() function. You can look in up in the awk guide; see the link in my signature.
sed might also work, but I am not sure how to express positions 30 to 33.
EDIT: substr, not sub.