in reply to using the split command

"I need this for my work!"

Then I need your paycheck.

Seriously, this is not code-o-matic (and even there, I think, you have to drop your nickle in the slot.)

The Monastery exists for many reasons, but doing your work isn't one of them. OTOH, we will -- and gladly -- help you over a problem, when you show you've tried to solve it (by posting your code, your sample data -- you did well there-- and any error messages or an explicit, detailed description of how your program failed and what it was supposed to do -- good job on that part, as well.

So really, all you need to do is:

P.S. re your "ex" code: it's not at all what's recommended above. See On asking for help and How do I post a question effectively?... and it's not in markup, <c>...code and data should be bracketed with code tags....</c> like those.

Fixed link for compare