Hello, I have a directory of files that I need to read in through a batch macro that I created. For some reason this batch macro is reading in the same files multiple times. I have tried using the unique tool to fix this issue but it hasn't worked. Thank you in advance.
I'll have to see a bit more of what your action tool is doing and also look at the settings in the Interface Designer.
I assume you get a list of xls files from the directory tool that you're then setting as the field in your control parameter.
Since you're not specifying a sheet name in the control parameter, I assume all sheets are named sheet1, so you're only replacing the field name and path up to the |||
In the Interface Designer settings you want to do this:
Hi @davidP, thank you very much for your help. This is a screenshot of the Action tool in the interface:
All sheet names from all files are 'Sheet0'. I have the output mode configured as you showed. I'm not sure why it is still pulling in duplicates. Thank you
Your directory tool produces an output like this:
With the Action tool in your batch macro, you're looking to update the filename and path in the Input data tool, but note that this also includes the sheet name in the input tool. You can therefore either add a formula tool after your directory tool to add "|||Sheet0" to [Fullpath] in order to use that to Update the value in the Input Data tool, or, you tell the action tool to only update the path and filename - you do this by checking the "Replace a specific string" at the bottom and specify that only the filename and path gets replaced, leaving the sheet name intact, as shown below.
Sample workflow and macro attached.