Being new to DOS, I am trying to write a batch file that replaces all the "|" by "," in files called test1.txt, test2.txt and output to files called test1.csv, test2.csv. It works fine for the first file but the second .csv file keeps the "|".
Here is my code:
@echo off
setlocal enabledelayedexpansion
for %%a in (test*.txt) do (
set line=%%a
type "!line:|=","!" > %%~na.csv
)
I read a thread mentioning that the "line" variable may be changed after parsing the block once, but I don't see how to fix the problem (I tried several modifications like "call" before "type" but still the same).
Any help would be great. Thanks !