天道酬勤,学无止境

file-search

How can I programmatically use Windows File Explorer to perform a Search?

We have a folder on our network that we want to search within, including subfolders, from our program. We want to return a list of files whose name contains "String1" or "String2" or "StringN". We would prefer to programmatically open an Explorer window and view all files that match the search results using the native windows file explorer. Is this possible? How? Thanks!

2021-06-28 03:46:29    分类:问答    c#   wpf   explorer   file-search

如何使用 grep 在文件夹中查找单词?(How can I use grep to find a word inside a folder?)

问题 在 Windows 中,我会搜索在文件夹中查找单词。 同样,我想知道特定单词是否出现在包含许多子目录和文件的目录中。 我对 grep 语法的搜索显示我必须指定文件名,即grep string filename 。 现在,我不知道文件名,那我该怎么办? 一个朋友建议做grep -nr string ,但我不知道这是什么意思,我没有得到任何结果(在我发出Ctrl + C之前没有任何反应)。 回答1 grep -nr 'yourString*' . 最后的点搜索当前目录。 每个参数的含义: -n Show relative line number in the file 'yourString*' String for search, followed by a wildcard character -r Recursively search subdirectories listed . Directory for search (current directory) grep -nr 'MobileAppSer*' . (会找到MobileAppServlet.java或MobileAppServlet.class或MobileAppServlet.txt ; 'MobileAppASer*.*'是另一种做同样事情的方法。) 要检查更多参数,请使用man grep命令。 回答2

2021-06-26 15:54:21    分类:技术分享    string   command-line   grep   keyword-search   file-search

如何编写自定义搜索过滤器来清除 R.java 文件? [复制](How do I write a custom search filter to weed out R.java files? [duplicate])

问题 这个问题在这里已经有了答案: 忽略查找结果中的 R.java 文件6 个回答 2年前关闭。 我正在尝试创建自定义搜索 à la 如何从 IntelliJ IDEA 搜索中排除文件扩展名? 在 Android Studio 中。 为什么以下模式不排除R.java文件? 请注意,第二个使用&&!file:R.java ,但范围不包含更少的文件。 回答1 问题是必须考虑文件的路径。 !file:R.java仅在根目录中查找R.java 。 要查找所有 R.Java 文件,必须使用!file:*/R.java : 请注意,第二个使用&&!file:*/R.java ,并且范围包含较少的文件。

2021-06-21 20:34:53    分类:技术分享    intellij-idea   android-studio   file-search

How do I write a custom search filter to weed out R.java files? [duplicate]

This question already has answers here: Ignore R.java files in Find results (6 answers) Closed 2 years ago. I'm trying to create a custom search à la How to exclude a file extension from IntelliJ IDEA search? in Android Studio. How come the following pattern doesn't exclude R.java files? Note that the second uses &&!file:R.java, yet the scope does not contain fewer files.

2021-05-12 12:50:45    分类:问答    intellij-idea   android-studio   file-search

How to use DirectoryInfo.GetFiles and have it stop after finding the first match?

Need to search the directory/sub-directories to find a file, would prefer it to stop once it has found one. Is this a feature built into DirectoryInfo.GetFiles that I am missing, or should I be using something else (self-implemented recursive search)?

2021-05-02 16:05:26    分类:问答    c#   getfiles   file-search

Fuzzy file search in linux console

Does anybody know a way to perform a quick fuzzy search from linux console? Quite often I come accross situation when I need to find a file in a project but I don't remember the exact filename. In Sublime text editor I would press Ctrl-P and type a part of the name, which will produce a list of the files to select from. That's an amazing feature I'm quite happy with. The problem is that in most cases I have to browse a code in a console on remote machines via ssh. So I'm wondering is there a tool similar to "Go Anywhere" feature for Linux console?

2021-04-12 13:18:34    分类:问答    linux   bash   file-search

Recursive File Search in .net

I need to search a drive (C:, D: etc) for a partuicular file type (extension like .xml, .csv, .xls). How do I preform a recursive search to loop all directories and inner directories and return the full path of where the file(s) are? or where can I get information on this? VB.NET or C# Thanks Edit ~ I am running into some errors like unable to access system volume access denied etc. Does anyone know where I can see some smaple code on implementing a file search? I just need to search a selected drive and return the full path of the file type for all the files found.

2021-04-09 01:17:55    分类:问答    file   io   .net   file-search

Recursive file search using C++ MFC?

What is the cleanest way to recursively search for files using C++ and MFC? EDIT: Do any of these solutions offer the ability to use multiple filters through one pass? I guess with CFileFind I could filter on *.* and then write custom code to further filter into different file types. Does anything offer built-in multiple filters (ie. *.exe,*.dll)? EDIT2: Just realized an obvious assumption that I was making that makes my previous EDIT invalid. If I am trying to do a recursive search with CFileFind, I have to use *.* as my wildcard because otherwise subdirectories won't be matched and no

2021-04-07 09:14:31    分类:问答    c++   mfc   recursion   file-search

递归文件搜索(PHP)(Recursive File Search (PHP))

问题 我正在尝试使用递归搜索返回指定目录中的文件。 我成功实现了这一点,但是我想添加几行代码,这些代码使我可以指定要返回的某些扩展名。 例如,仅返回目录中的.jpg文件。 这是我的代码, <?php $it = new RecursiveDirectoryIterator("L:\folder\folder\folder"); foreach(new RecursiveIteratorIterator($it) as $file) { echo $file . "<br/> \n"; } ?> 请让我知道我可以在上述代码中添加些什么来实现此目标,谢谢 回答1 <?php $it = new RecursiveDirectoryIterator("L:\folder\folder\folder"); $display = Array ( 'jpeg', 'jpg' ); foreach(new RecursiveIteratorIterator($it) as $file) { if (in_array(strtolower(array_pop(explode('.', $file))), $display)) echo $file . "<br/> \n"; } ?> 回答2 您应该创建一个过滤器: class JpegOnlyFilter extends

2021-04-07 01:55:13    分类:技术分享    php   file-search

How to make eclipse “File Search” to also search inside source jars containing some text?

I am working on a (Java) project in which I have many jars which have a source-jar file attached. Is there any way to make the eclipse "File Search" search for Java files (and txt, xml etc. for that matter) containing some string literal inside these source jars, not just in the project folder? Or is there any plugin by which this can be achieved?

2021-04-06 03:02:53    分类:问答    eclipse   jar   literals   file-search