Solved How to replace comma with space using batch script

February 3, 2015 at 22:41:38
Specs: Windows 7
Hi all,

I am very new to batch script.
I have many text files in the folder D\Folder\Data\Data
i want to replace all the comma in each text file with space.
Could some one please help me do this script


See More: How to replace comma with space using batch script

Report •

#1
February 4, 2015 at 03:56:15
✔ Best Answer
Here the script not tested and pay attention it removes all blank lines. If the blank lines have to bevretained a variant is needed.

@echo off & setlocal EnableDelayedExpansion
pushd D:\Folder\Data\Data
for %%j in (*.txt) do for /F "tokens=* delims=" %%k  in ('type "%%j"') do (
  set row=%%k
  sei row=!row:,= !
  echo.!row!
) >>  "%%~nj.t$t"
del *.txt
ren *.t$t *.txt
popd


Report •
Related Solutions


Ask Question