in reply to Using Split function

You can eliminate most of your code by using the Command Switches -F which implies -a and -n.
Bill