Find files in directory with specified text content

RudySchneider

New Member
Joined
Oct 21, 2015
Messages
7
I tried to be as descriptive as possible with that title, and there may already exist a post that would help me, but...

1. I have a spreadsheet with many rows of wire harness numbers.
2. Going into Windows Explorer, I can navigate to a top-level directory and search for all the (Visio) files that contain that harness number.
3. I can then manually enter the file name(s) (or file number(s)) into a cell to the right of the harness of interest.
4. Repeat for next row (harness number).

Yeah, that works fine, but I've got a whole lotta harnesses for which I must search. Yes, I am capable of eventually writing my own VBA or macro to automate the above process, but with all the talent here, I'm hoping someone has had a similar challenge that he/she has already mastered, or a related post to which someone can direct me.

Thanks in advance --- Rudy
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Unfortunately, Tracy (I have a daughter named Tracey!) ---
That solution seems to have taken me on a round-robin quest (which included a discussion about Application.FileSearch no longer being available for Windows 7.

I have found a couple of other interesting, and possibly useful posts, but no cigar, yet. By the way, I found code for a program that will search files with Excel or PDF extensions, but it doesn't like Visio (.vsd) files.
 
Upvote 0
Tracy ---
So it's lookin' like this isn't gonna be the quick fix I was hoping for after all. Because I need to make some forward progress at work, I've done half of the search job manually, now. But I really do want to end up with a tool I can have for future use, so it looks like I'll be playin' with it over the weekend at home.

Thanks for the assist anyway --- Rudy
 
Upvote 0
You're asking for quite a bit of a program.
How often do your file names change? If not that often, a possible solution would be to have a program that gets all the vsd filepath and places them on a sheet. A formula can extract the harness number from the filename. Another formula on your lock up sheet does the rest. That would be the quickest solution. Else, a more efficient program that looks at the file structure every time you write it would take longer to write. Write it less efficiently and it could take 30 minutes to run (depending on how many harnesses to lookup).
 
Upvote 0
Harness numbers are not likely to change, but the schematics that reference them may change periodically. That's why it would be nice to have some way to scan the Visio drawings to determine on which drawing(s) a harness appears. As I said in my original post, I can easily do this in Windows Explorer, by going down my spreadsheet line-by-line. The primary detraction from this approach is that there is always the potential for human error, primarily with transcription. I'm looking for a way to automate the task to minimize or eliminate this potential. I'm convinced I can write a macro to do what I'm after, it'll just take me a bit more time than I was hoping.

Now worries, I've already completed the task manually, but I fully intend to make use of some of the features I've seen in other programs I've found in my search to come up with a tool I can use in future.
 
Upvote 0
when you say scan the drawings - do you mean the CONTENTS (as in open the file or use file preview) or the filename.
I don't know of any way to get VBA to scan the contents.. might be possible with an api.

If it's file names - then a program that creates the sheet i mentioned would be feasible.
 
Upvote 0
Nope, not file names, but file content for an ASCII text string. And if it an be done in Windows Explorer, it's GOTTA be possible to do it in VBA, or I'd be SORELY disappointed in VBA!
 
Upvote 0

Forum statistics

Threads
1,215,064
Messages
6,122,936
Members
449,094
Latest member
teemeren

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top