DOS search for file contents? Like Grep
Posted: 07 Dec 2022 07:00
I need to search file contents. 99% of the time CSV files.
Windows explorer has a setting when searching that allows you to search file contents.
This is great. Except it doesn't always work.
I've used Grep in the past. That was a long time ago.
I don't actually want to install Grep.
But then just wondering if I could use a DOS command, similar to do what Grep does?
How efficient would it be?
In my folders, I'd have say 10,000 CSV files - all less than 10kb.
Not sure where to start and what commands to use.
I did a google and see suggestion for: findstr and find commands.
I tried find. I made a call like this:
That gave me some results that weren't helpful (in terms of display).
And I got this message: Access denied - on some folders. I opened CMD as admin and still got the same.
Hopefully I can get some pointers on what I should do.
Thanks.
Windows explorer has a setting when searching that allows you to search file contents.
This is great. Except it doesn't always work.
I've used Grep in the past. That was a long time ago.
I don't actually want to install Grep.
But then just wondering if I could use a DOS command, similar to do what Grep does?
How efficient would it be?
In my folders, I'd have say 10,000 CSV files - all less than 10kb.
Not sure where to start and what commands to use.
I did a google and see suggestion for: findstr and find commands.
I tried find. I made a call like this:
Code: Select all
find "my string to search" *.*
And I got this message: Access denied - on some folders. I opened CMD as admin and still got the same.
Hopefully I can get some pointers on what I should do.
Thanks.