Extract File Name from File Directory
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Dear Community,
May i know how can i extract the file name from the file directory as below:
Directory examples
1.C:\Users\XXXX\Desktop\Alteryx\ABC\UDJD Input.csv
2.C:\Users\XXXX\Desktop\Alteryx\ABC\URKELC\XJX1828.csv
3.C:\Users\XXXX\Desktop\Alteryx\ABC\5324.csv
4.C:\Users\XXXX\Desktop\Alteryx\BD\92.csv
5.C:\Users\XXXX\Desktop\BD33\1nbfi.csv
Results wanted
1.UDJD Input
2. XJX1828
3.5324
4.92
5.1nbfi
Many thanks for your help
Solved! Go to Solution.
- Labels:
- Common Use Cases
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hey @SH_94 ,
We can use regex to get that filename.
If you want to learn more about regex: https://community.alteryx.com/t5/Alteryx-Designer-Knowledge-Base/Tool-Mastery-RegEx/ta-p/37689
Best,
Fernando Vizcaino
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Mindblown 😮 where did you come across this. This works amazingly for this scenario.
Workflow:
Thank you for this knowledge share 🙂 @HomesickSurfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thank you @atcodedog05
I make good use of the various 'GET' functions. They're efficient.
@SH_94 , you may wish to additionally filter to exclude backups, temp files, etc as follows, or config your file specification in the Directory tool to only include filetypes you seek.
FileGetExt([FullPath])!=".bak" OR "~$"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator