4 Replies Latest reply: Feb 3, 2013 2:47 PM by Alessandro Furtado RSS

    Seperating values into seperate columns

      Hi,
      I have another scripting challange! I have a single column from a database that is storing multiple categories seperated with a '|' (pipe). The number of categories a user can select is not limited, so some strings may have 1, 2 or 3 categories, but some may have potentially many more. I need to split out each substring into seprate colums.
      IDCategories
      1Car
      2Car|Bike
      3Car|Bike|Boat
      4Car|Bike|Boat|Plane
      I require a table that looks like this
      ID1234
      1Car
      2CarBike
      3CarBikeBoat
      4CarBikeBoatPlane
      Just to be clear, I do not know the number of columns that would need to be generated up front, so I cannot use simple string manipulation to extract the segments.
      Thanks
      Haider