We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
fireworks

RegEx Text Search in All Files' Contents in Directories and Its Sub Directories

domo_arigatoo
7 - Meteor

Hi,

 

Is it possible to create an Alteryx workflow to perform a regular expression text search in all files' contents in specified directory and all of its sub directories?

 

Thanks!

4 REPLIES 4
PhilipMannering
16 - Nebula
16 - Nebula

Sure it is. Just have the Directory Tool (with Include Subdirectories ticked) to bring in the paths of all files. And then use the Regex Tool,

PhilipMannering_0-1614246189748.png

 

domo_arigatoo
7 - Meteor

Hi @PhilipMannering,

 

I have made some corrections in my initial post. I would like to search the contents of all files, not searching the path of all files.

 

Thanks.

PhilipMannering
16 - Nebula
16 - Nebula

Ah, I see. That's more difficult. I would do it in Powershell. You can execute powershell commands in the Run Command Tool by prepending the command with `powershell`. The command would look something like,

Get-ChildItem -Path C:\Users\Philip\Desktop\ -file -recurse | foreach-object {select-string $_ -Pattern 'regex'}

 

where `C:\Users\Philip\Desktop\` is the directory you're looking in, and `regex` is your regular expression. I could build this into a tool, but would take longer. 

 

Hope this helps.

Philip

domo_arigatoo
7 - Meteor

Thanks @PhilipMannering on using Powershell. 

Labels
Top Solution Authors