文本文件末尾总是有一个双引号......
"1","abc","123"
"2","abcd","456"
"3","abce","789"
"
我需要一个命令才能通过cmd.exe
来删除最后一行(单引号)...
"1","abc","123"
"2","abcd","456"
"3","abce","789"
答案 0 :(得分:0)
延长了我的previous answer:
@echo off
copy t.txt old.txt
<nul >"new.txt" set /p x="""
>>"new.txt" (type "old.txt" |findstr /v "^.$")
rem move /y "old.txt" "new.txt"
type new.txt
附加findstr /v
排除了包含单个字符的行(使用"
很难处理,但我想,“单字符行”已经足够了)