Kindly suggest how can I search a text string which will be input by the user in all files of a directory.
Thanks in advance!!
Kindly suggest how can I search a text string which will be input by the user in all files of a directory.
Thanks in advance!!
Just use grep. On Windows download GNU grep or other free available grep.
findstr is your friend.
For example, to find all files containing Hello:
findstr Hello *
It also allows subdirectory searches (/s
) and regular expressions (/r
) as well.
Of course, you can't achieve real power unless you install and use the Cygwin or GnuWin32 tools. Cygwin if you want an entire UNIX-like environment or GnuWin32 if you just want select tools.