This script maybe could do it. It needs a little modification, but it should work to split plain text.