What would be a good approach for searching multiple keywords within multiple files in a folder and its sub-folders?
In the posting below, the Search Directory tool is recommended. I have used it successfully for a single keyword, and in .txt files only. I was unable to apply it to .docx files.
https://community.alteryx.com/t5/Alteryx-Designer-Discussions/Key-word-searching-in-multiple-files-and-multiple-tabs-per-file/td-p/20058
For .xlsx files, the CReW macro Wildcard XLSX Input provide a good path.
I am excluding .pdf and images as it seems that those require separate handling.
Thanks
For some reason it won't allow me to attach macros, so I've saved it as a workflow. You'll have to save it as a macro at your end.
Hi @aesanchez ,
You could use the Directory input to determine the file type that you wish to bring in. Then, you can use a text input to create a list of the keywords you would like to include, then simply build a macro with a control parameter of each keyword applying a filter to the filename where the keyword is contained.
This would bring in a list of all, for example .csv files in the folder and subfolders, then will cycle through an bring in all that contain each keyword.
M.
Hi @mceleavey
Would that work to identify the files where the keywords are contained in the filename? I need to accomplish that, and also identify the files that contain the keywords within their content The Search Directory tools is working right now for .txt files but not .docx.