This is the input file:-
Hello,1-23456
How are you,2-34567
.
.
.
I want output:-
1-23456,Hello
2-34567,How are you
.
.
.
请帮我为此创建一个批处理文件 .
我试过这个
@echo off &setlocal
set "textfile=inputchq.csv"
set "newfile=output.txt"
(for /f "tokens=1,2 delims=," %%i in (%textfile%) do set srno=%%a&set comments=%%b (
set "line=%%i"
setlocal enabledelayedexpansion
set "line=%comments%,%srno%"
echo(!line!
endlocal
))>>"%newfile%"
但我没有得到理想的输出
1 回答
编辑以匹配评论中的其他要求:
你需要延迟扩展并逃避特殊字符“|”