SDF/SMILES file splitter

Hi,

Is there any way to split an sdf / smiles file into pieces of e.g. 1000 molecules iteratively, so a workflow is executed several times on 1000 molecules until it reaches the end of the sdf/smiles file? The reason for splitting is that external tools involved in the workflow work optimally with less than 1000 structures. I tried X-loop node, however, I could not figure out how to make it extract a new portion of molecules at each iteration. Moreover, the number of iterations in X-loop node has to be defined, which is useless given the unknown size of the original file. Any help and ideas on this issue would highly appreciated! Many thanks!

/Aleksejs