i have some trouble about convert file tsv to file csv with .bat. Problem is i can't convert when i change data with tab and spaces
My current source
setlocal disableDelayedExpansion
set OUT_DIR1=%1
set input=%OUT_DIR1%\%2
set output=%OUT_DIR1%\%3
set IN_DIR=%4
type %IN_DIR%\*.tsv > %OUT_DIR1%\result.tsv
>%output% (
for /F "tokens=* delims=" %%a in (%input%) do (
set "line="
setlocal enableDelayedExpansion
for %%b in (%%a) do set "line=!line!,%%b"
echo !line:~1!
endlocal
)
)
My input file
0001 abc de mo1 abc
0001 a bc de mo2 abc
0001 abc de mo3 a bc
0001 a bc de mo4 a bc
My output i want
0001,abc,demo1,abc
0001,abc,demo2,abc
0001,abc,demo3,abc
0001,abc,demo4,abc
Please help me!!!!!!!!!!!!!!!!!!!