Please note I read a similar question about splitting a column of a data frame to multiple columns, but my case is different.
My form of data is as follows:
name description
1 a hello|hello again|something
2 b hello again|something|hello
3 c hello again|hello
4 d
I'd like to split the description column as follows:
name description_1 description_2 description_3
1 a hello hello again something
2 b hello hello again something
3 c hello hello again N/A
4 d N/A N/A N/A
Any suggestions, directions?
EDIT: Following @akrun and @Sotos answers (thanks!), here's a more accurate presentation of my data:
name description
1 a add words|change|approximate
2 b control|access|approximate
4 d
therefore, sorting the data alphabetically results in:
name description_1 description_2 description_3
1 a add words approximate change
2 b access approximate control
4 d N/A N/A N/A
while, what I need is:
name desc_1 desc_2 desc_3 desc_4 desc_5
1 a add words approximate change N/A N/A
2 b N/A approximate N/A control access
4 d N/A N/A N/A N/A N/A
I don't mind how description is sorted (if at all), as long as at each column (desc_1..5) I will have the same description. Hopefully, that clarifies my problem.