Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

String replacement not working

21 views
Skip to first unread message

sandeep...@gmail.com

unread,
Sep 17, 2018, 2:25:47 AM9/17/18
to
I am trying to do a string replacement in a batch file and it is not working. What am I doing wrong? All I want to accomplish is to remove the thousand comma separators in the number

===============Script===============
@echo off

for /f "tokens=1,2,4,5,7,8 delims=;" %%A in (Test.csv) do (

set myAmt=%%D:,=%
echo D : %%D
echo Amount : %myAmt%
)
===============Script===============

================Test.csv file========
A;B;C;D;-1,00,194.00;F;F;G
A;B;C;D;-1,000.00;F;F;G
================Test.csv file========

===============Output===============
D : -1,00,194.00
Amount : 1,00,194.00:,=
D : -1,000.00
Amount : 1,00,194.00:,=
===============Output===============
0 new messages