如果文本中没有@这个特殊字符存在的话代码可以将代码再修改如下:- @Echo Off&SetLocal EnableDelayedExpansion
- Rem 请将下面的Tab变量的值替换为实际的制表符
- Set "Tab= "
- For /F "delims=" %%a In ('Dir /b ABC*.txt') Do (
- (For /F "delims=" %%b In (%%a) Do (
- Set "Str=%%b"&Set "Str=!Str:%Tab%=@#$!"
- For /F "tokens=5 delims=@" %%c in ("!Str!") Do (
- If "%%c" EQU "#$9" Echo %%b
- If "%%c" EQU "#$" Echo %%b
- )
- ))>%%~na_1.txt
- )
复制代码
|