有个文件1.txt,内容是
12
123#
#123
##12
#12#34#
# aaaa
#
####
要删除所有以#开头,并且有且只有一个#的行
处理后变成
12
123#
##12
#12#34#
####
应该用for 实现吗?- (FOR /f "eol=# delims=" %%i in (1.txt) do (echo %%i))>2.txt
- for /f "tokens=2 delims=#" %%i in (1.txt) do (
- if not %%i=="" echo %%i>>2.txt
- )
复制代码
|