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