Visual Studio 查找不包含 X 的文件 [英] Visual studio Find files that does NOT contain X

查看:23
本文介绍了Visual Studio 查找不包含 X 的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一种方法来列出所有包含已知文本的文件.

I need a way to list all files that does NOT contain a known text.

该项目包含超过 1000 个文件,我只想要不包含某些文本的文件.

The project contains over 1000 files and I only want the ones that does not contain some text.

我想到了正则表达式,但是没有这个功能.

I thought of Regular expressions, but it doesn't have such a feature.

有人知道解决办法吗?

推荐答案

从命令提示符:

@for /r %f in (FILE_SPECIFIER) do @find "YOUR_STRING" "%f" > nul || echo %f

例如:

C:web-trunkViews>@for /r %f in (*.cshtml) do @find "Layout" "%f" > nul || echo %f

C:dataweb-trunkViewsAccountRegisterPartial.cshtml
C:dataweb-trunkViewsAdminSiteInspector.cshtml
C:dataweb-trunkViewsCandidateProfileView.cshtml
C:dataweb-trunkViewsCommonContactFooterForInfoEmails.cshtml
C:dataweb-trunkViewsCommonContactFooterForInfoPages.cshtml
C:dataweb-trunkViewsCommonContactFooterForSalesEmails.cshtml
C:dataweb-trunkViewsCommonContactFooterForSalesPages.cshtml

Microsoft 的文档 关于此方法可以帮助您找到最适合您的文件搜索词.

Microsoft's documentation on this method can help finding the best file search term for you.

这篇关于Visual Studio 查找不包含 X 的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆