I on't know much about TeX, but it seems the best advice would be to search whether some CPAN module will help you in parsing your files to find the proper location.
In reply to Re: adding lines at specific addresses
by Skeeve
in thread adding lines at specific addresses
by pindar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |