Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在多行中有如下字符串的文本文件
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!