This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
It’s about time I release my “Input Batch” macro, so here we go......
For those of you familiar with the Dynamic Input, you will know how much of a life saver it can be, but from time to time, you may be frustrated by the need for the file formats to be the same. Both the type of file (Excel, CSV, TXT etc) and also schema (field types, size and number/name of columns).
This can often cause a few issues, as Alteryx reads in the template and will then use that as the type of file, and then the first file it reads in dictates the schema.
Well, if you want the ability to read in many different types and many different schemas at once, you are in luck!
I have built a macro (with a sub-macro) that will be able to read in: ".yxdb",".cydb",".sz",".avro",".csv",".dbf",".mdb",".xls",".xlsx",".xlsm",".sas7bdat",".sav",".sqlite",".xml”
The input required is the full path with extension. This enables you to use the directory tool, apply any logic to filter the list (AKA get todays files) and then input that in.
After that it will go through all the files and read them in. Then using the power of Union it will align all columns named the same, any extra columns get added to the end.
There is also some extra stuff when it comes to Excel, it will actually loop through all the sheets and read them in one by one.
Hopefully some of you will find this useful.
If you provide it file types that it is not able to read, it will through a warning.
Feel free to add comments about future enhancements and I’ll look to see if I can add them in.
Attached is a zip file (.7z), with the installer (.yxi) and some sample data with a sample workflow.
Is it possible to configure it so I can output for Rows 10 and beyond
How would I output just the filename? Right now when I batch the files, the full path is being pulled and I just want the filename
Thanks for the assistance.
You're welcome, I am glad you are finding it useful.
To update it to only output from 10 rows and beyond, you'd need to open up the macro and modify the input tools within. I'd then recommend saving this as your bespoke version as my guess is it won't always be from row 10 in all uses?
For the second part you could modify the input tool as well, but there is a nice easy function in Alteryx to extract the file name from a file path:
That should then give you what you need without changing the macro itself.