I would like to split a structured “OU” -path, “\domain\OU\2nd_OU\3rd_OU\4th_OU\nth_OU” from a cell in each row to build a grouping. I would like to use the last OU string as a grouypby selection.
I can split it and put them in new columns, but how can I select always the last one and filter the rest out ?
The OU is “Organizational Unit” from LDAP, so a sample would be like this:
Below is Active Directory OU structure, written down to single line paths for different OUs
Domain.com\Member Server\Country A\City A\Application\Role A Domain.com\Member Server\Country A\City A\Application\Role B Domain.com\Member Server\Country B\City B\Service B\Application\Role A Domain.com\Member Server\Country AC\City C\Service C\Application\Role B Domain.com\Workstations\Country A\City A\Office A Domain.com\Workstations\Country A\City B\Office B\Win7 Domain.com\Workstations\Country A\City B\Office B\Win10
…
So the length and content is variable, I would like to select the last or sometimes any other part of that path… Sometimes the 3rd from the start (Country) or 4th for CIty and then Group_by with that info.
sorry for not being clear on the first post, but I hope this clears it up a bit ?
To get the leaf sub folder (the last one each time) you can try this inside a string manipulation node, where your list of directories is the $directory_column$
following @mrman100 reversing idea maybe you can try first reversing your column using reverse() function from String Manipulation node and then splitting. This way last part (OU) will always be in the first column