- Open the file
- Read the file blockwise by using an input record separator, see perldoc perlvar, eg. '}' provided that character does not appear anywhere else in your data.
- Split each blocks into lines and look for StrCatDone
- Depending on the value after StrCatDone alter the following line.
- Output the (possibly altered) block.
Transform this into code and post it here if you have any problems with it.
-- Hofmator
Code written by Hofmator and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.