8 Replies Latest reply on Oct 17, 2018 10:57 PM by Tim Guth

    Split/Cut text after last 2 delimiters

    Tim Guth

      Hey Guys,


      I am currently facing some data management problems. I got a file like the following:


      name, age/year born, body fat%, height, weight


      James Smith 43 year old 18%, 180, 86

      Thomas Miller 1980 16.5%, 187, 81

      Dean Thomas, 36 year old 13.1%, 174, 71


      I need a new column with only "name, age/year born, body fat%" and cut off after the last 2 delimiters (commas in this case). As you see in the data, I cannot go from the left side since sametimes name, age/year, and body fat are separated by a comma, sometimes not. I cann only rely on height and weight being separated by a comma. I would like to have a column like this -->


      James Smith 43 year old 18%

      Thomas Miller 1980 16.5%,

      Dean Thomas, 36 year old 13.1%


      Which code would I need for it? I tried first with a custom split but the main column remains and doesn't delete the last 2 information delimited by the comma.


      Thanks a lot for your help!