you can get around the 1000 line limit by calling subroutines.
split the original file into 800 (or so) line segments, adding the return code to the end of each.
Consecutively name each file.
create first file to do nothing but call the subs. p.s. put your subs in the subfolder.
I've processed over 200k lines this way.
As always, support your favorite software.