problem:
read files and subfiles from a folder. BUT don;t hardcode the values in Directory tool
Issue:
Folder & file name/path will be stored in spreadsheet
Folder Path | File Name |
C:\Alteryx\test | Company*.xls |
C:\Alteryx\test | bank.csv |
get folder,file name --> input this to Directory tool --> read data --> process --> repeat for the second line
Output:
data from all the files together for each row
row 1 - output 1
row 2 - output 2
if the input data has 10 rows then 10 output files.
but if input data has 1 row then only 1 output file.
@sbatra116 I think I understand what you want and it sounds like an iterative macro. At what point do you want to stop looping through directories? Is it just the file structure your after or do you want every file to be mashed into one? Do you need to read every sheet in each excel file?
Mash all the files together for each row -- this will be output
row 1 - output 1
row 2 - output 2
if the input data has 10 rows then 10 output files.
but if input data has 1 row then only 1 output file.
-- Updating the original post with this --
A batch macro would let you pass a bunch of values to a directory tool:
And then update and output the results of each:
And if you tick add sub directories you would get every file included within that directory with it:
I tried similar. NOT WORKING
below macro screenshot asks me to set directory (which i don;t want to) as this will come as input.
another issue: how to pass the second parameter required for directory tool ?
Workflow screenshot
Hey @sbatra116 the community has some great videos on macros Interactive Lessons - Alteryx Community essentially batch macros will loop through each row and apply the logic. So when it says set the directory tool it just means it will dynamically change the value from the values you give it.