0

I have a dataset with two columns where I want to separate the second one (delimited by |) into many columns.

id     column
1       a|b|a
2       a|b|c|d|e
3       a|c|c

I would like to have columns with the name of each item and its count. for example for user 1 it would be as follows:

id    a    b     c     d     e
1     2    1     0     0     0
2     1    1     1     1     1

How do I get to separate this data such that the values are distributed in columns as such?

principe
  • 173
  • 1
  • 1
  • 11
  • @Cettt is there anyway I can separate the column such that the column has the name of the item (for example a) and the observation would have the count? for example if id 1 has a|a|a, I want a column a for that user with a count of 3 – principe Apr 29 '19 at 22:15
  • you should ask this as a new question and write your title based on it. I don't think you have a duplicate question, but your current title makes your question sound like a duplicate. – AcademicDialysis Apr 29 '19 at 22:28

0 Answers0