Hi everyone,
I am still getting my hands on understanding batch macros. Originally, I created the macro because I have a huge directory of files with different schemas and needed to merge them together. One thing I need to include now is the Creation Time in order to perform further analysis. I tried included a select field and appended it before connecting to the output in the macro, but when I run my overall workflow it does not output the creation time. Does anyone have any ideas how to do this?
This is my batch macro
This is my workflow which is able to join the files together, though it does not read the select field that I appended to include the creation time for some reason
Solved! Go to Solution.
Hi @jason79121,
I've got two thoughts on this, firstly are you looking to bring in the creation time of the input file itself or the time at which it was all merged together?
Secondly, if you're looking to bring in the creation time of each input file you could import the file name as part of the batch macro and join it back to the original directory tool to bring in the creation date info.
If you need a hand mocking up an example just let me know!
Kind regards,
Jonathan
Hi Jonathan,
I am looking to bring in the creation time of the file itself as I need to perform a comparison of dates after the macro is run.
Would you be able to show me an example of the inputting the file name and joining it back please?
Best,
Jason
Hi @jason79121,
If you use your batch macro to draw through the file name you'd be able to join it back to the original directory tool (containing the creation date):
If you have any questions just let me know, i've attached my workflow for you to download!
Kind regards,
Jonathan
Thanks Jonathan!
I ran into some issues unfortunately. It seems I can't get the filename to match in the join because it is not an option after my macro runs (all of the column names change), making me lose the fullpath, filename and creation date and outputting the columns in the individual files. Do you have any idea how I can get these back in order to perform the join?
I tried checking off "Output filename as field", but i still seem to lose it after the macro runs
Hi @jason79121,
I would double check the output you're getting from the macro in terms of the file name (most likely something along the lines of "filename.fileextension"), in comparison it looks as though your workflow is not generating the equivalent for your other join condition (i.e. the bottom stream in your workflow). If the two values aren't identical you won't be able to join on them.
Have you got an example of a file, what string are you returning from the macro and what string are you returning from the bottom stream to use as the join condition?
Kind regards,
Jonathan
I figured it out, seems I had to close out and refresh the macro! Thank you for your help!
No problem at all!