@JohnYaya if you can show a sample, it would be very helpful.
If your header and footer is static, and always predictable for a specific file you can replaceText and get "in between" lines using those static header/footer matches with a very creative regex...