split columns into new columns

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

split columns into new columns

This post has NOT been accepted by the mailing list yet.
I have a dataframe having 40 columns and they are "|" separated and many columns having values with ^ separated.I want to split each record in a new column.

How to split the columns in as many time as the separator "|" has occurred.



phone1|phone2|contact1|contact2| ERN~5XXXXXXX7|EPN~58XXXX91551~|C~MXXXH~MSO~|CAxxE~~~~~~3XXX5|

how can it be achieved using UDF and delimiter(^)  between the values may vary between 2 to 100+