3
有了这个批处理文件,我得到的输出txt文件的每一行后面有个空格:回声写在批处理文件后间隔
@echo off
setlocal enabledelayedexpansion
for /f "delims==" %%A in (trimlist.txt) do set string=%%A & echo !string:,=.!>>trimlist-new.txt
我该如何去有关删除尾随空格?如果可能,我想避免创建一个新的批处理文件。
@Dodekeract批处理文件已经[传统技术在Windows(https://en.wikipedia.org/wiki/Windows_PowerShell)自2006年 - *十年,四,五个主要的Windows版本前*。不足为奇的是,PowerShell拥有更多的字符串处理选项,例如'gc trimlist.txt |%{($ _ -split'=')[0] - 替换'3','。' } >> trimlist-new.txt' - 或者其他写作方式。 – TessellatingHeckler