更新时间:2023-02-09 13:09:02
如果要在要检查的空白中包含 Tab 字符,则必须使用批处理脚本.如果您尝试 Tab 或将 Tab 字符粘贴到控制台中,那么 cmd
控制台只会使您烦恼.但是 cmd
在 .bat
文件中解释 Tab 没问题.
If you want to include Tab characters as part of the whitespace you want to check, you have to use a batch script. The cmd
console simply makes an annoyed sound at you if you try to Tab or paste a Tab character into the console. But cmd
interprets Tab in a .bat
file no problem.
将其放入批处理文件中并运行,将 Space 和 Tab 替换为实际的空间和制表符.
Put this into a batch file and run it, replacing Space and Tab with an actual space and tab.
findstr/r/v/c:"^ [
Space Tab]"/c:"^ $""%〜1> result.out
第一个/c:
在行的开头检查空格.第二个/c:
检查空白行.两者都可以通过/v
开关忽略.
The first /c:
checks for whitespace at the beginning of a line. The second /c:
checks for blank lines. Both are omitted with the /v
switch.