-1
我有文本文件,如下面的多行Windows批處理腳本,多行結合起來,以逗號分隔的單行
1234
234545
123
16322
我需要像使用Windows批處理腳本
1234,234545,123,16322
我有文本文件,如下面的多行Windows批處理腳本,多行結合起來,以逗號分隔的單行
1234
234545
123
16322
我需要像使用Windows批處理腳本
1234,234545,123,16322
嘗試輸出字符串這個:
@echo off
setlocal EnableDelayedExpansion
set "txt="
set input=input.txt
for /f "delims=" %%a in (%input%) do (
set "txt=!txt!%%a,"
)
set "txt=!txt:~0,-1!"
>new.txt echo !txt!
太棒了,工作。謝謝馬特 – user2904026
你也可以用Notepad ++這樣的程序用「,」替換「\ r \ n」。不是一個批次的答案,但這對於一個情況非常有用。 – UnhandledExcepSean