Hi All,
how to extract the data from Directory tool. I get the File attributes and not the actual data.
how can I get the data from Directory tool.
Also, The input tool does not pick all the files from the folder, hence I cant use the input tool.
Solved! Go to Solution.
Here you go!
You need to use a macro and within the macro, you have to set the action tool the right way :-). It's just a batch macro that takes all filenames from the directory tool.
Hope it helps,
Greetings,
Seb
Hi @Manjari
To add on to @Sebastiaandb 's solution. This is expected behavior of the directory tool. You can pass it through to a batch macro as demonstrated above, or alternatively to a dynamic input tool.
Did you try using a wildcard in your normal input tool? For many file types this should work if the schema is consistent. For example, instead of specifying a specific file you can do C:\Filepath\*.csv and it will take all the csvs in that file path.
Hi @Sebastiaandb, I tried your solution, but I find the output gives me the data of the first file (which is linked to the macro to be replaced after every iteration) multiple times.
For eg. Here is a data set example attached: I have 2 files in a folder
1. Chocolate.xlsx
2. Icecream.xlsx
Chocolate.xlsx is linked to the macro when creating the macro.
The output I get is:
Chocolate | File name |
Chocolate | Chocolate |
Chocolate | Chocolate |
The Output is twice of the first file, Since I have 2 files. If I have 9 files with Chocolate will be present 9 times.
@Luke_C : Yes, I tried the wildcard character, I have used it many times in the past It used to pick up all the files in the folder. But unfortunately for the original data set I have it picks 3 file out of 9. Really not sure why.
@gabrielvilella : Thank you soo much. The macro worked like a charm.