Searching multiple keywords within multiple files in a folder and its sub-folders
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
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
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @aesanchez ,
That would only deal with the filenames. Once you've loaded them in then can apply a filter using the same Keyword text input (or whatever format) to search for the words within the content. That part is easy as you are simply dealing with text within the data once it's loaded in.
I've attached the macro for you. Hope it helps.
M.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thank you. This points me in the right direction.
