Getting the last part of a delimited string
Sometimes, when working with delimited fields, we need to keep the last part of each, and the number of columns is unknown. One of the most frequent use cases is parsing a path/UNC/URL and getting the filename, which is at the end of the string.
This recipe is ideal for these use cases, where we have a delimited field but we don’t know the number of columns, and we need the last one(s) – for example, the filename of a complete path.
Getting ready
We prepared a test here: https://github.com/PacktPublishing/Alteryx-Designer-Cookbook/tree/main/ch5/Recipe2.
We have a list of files, and we need to retrieve the filename and extension from them, but since they are distributed across different folders and subfolders, splitting the whole path by a delimiter (like we do with the Text To Columns tool) will require a lot of post-processing tasks.
How to do it…
We’ll start by showing the regular procedure...