How to find a string in multiple files in a directory.
posted 6 years ago
I can find a string in specific file when the file is in the same directory as the .class file. But what I need to do is find a string that exists in multiple files in a directory and it's subdirectories. I know I can "grep" the string and that works fine, but I need to get rid of the "grep" and use java.
the grep command looks like this: "grep -rh 'new FieldSpec[\\s.]' R:\\glog\\server\\agent\\", how would I convert that into java code?
Thanks in advance.