Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Get Folder Name from FilePath

saachitalwar
8 - Asteroid

I have file paths in the format - \\abc.ad.def.com\home2\desk\SID\jpmDesk\Desktop\01- USMT\Diary.xlsx|||Events

 

There are folder names like 01 - XYZ,02 - ABC,01 - ABC xyz, 03 - DEF etc.

 

All these folders have a file called diary.

 

I want to combine the diaries files of all folders having the same first 2 character so 01 - XYZ, 01 - ABC xyz diaries would combined.

 

How can I do this? I have used a macro to open all the files with Diary name so far. 

2 REPLIES 2
Andrew_T-H
7 - Meteor

You could use a Directory Input tool to list all the folder names and then use RegEx to parse out the first two characters followed by a Unique tool to show all duplicate rows with the same characters, You could then add a filter for each one and a dynamic input to read the files that have been filtered on with the same first two characters and it will union the sheets.

Do you have an example/dummy workflow that you could share so I can get a better understanding of what you need? 

saachitalwar
8 - Asteroid

This is basically the wf I have so far.

Folders would be like

ABC

ABC copy

ABC copy 2

DEF 

DEF copy

 

I need to go in each folder, get the diary file and then combine all the ABC copies into one file in the ABC folder and so on

Labels
Top Solution Authors