replacing "," by "." or vice versa not working

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
pstein
Posts: 125
Joined: 09 Nov 2011 01:42

replacing "," by "." or vice versa not working

#1 Post by pstein » 21 Jan 2015 00:35

According to some tutorials I tried to replace a comma "," by a dot "." with the following instruction

set numvalue=9,23455
set numvalue=%numvalue:,=.%

...but it doesn't work.

How else can I achieve this?

How does the other way go?

miskox
Posts: 668
Joined: 28 Jun 2010 03:46

Re: replacing "," by "." or vice versa not working

#2 Post by miskox » 21 Jan 2015 01:00

Well, it works for me:

Code: Select all

@echo off
set numvalue=9,23455

echo _%numvalue%_
set numvalue=%numvalue:,=.%

echo _%numvalue%_


Result:

Code: Select all

C:\>a.cmd
_9,23455_
_9.23455_

C:\>


Saso

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: replacing "," by "." or vice versa not working

#3 Post by foxidrive » 21 Jan 2015 03:21

pstein wrote:According to some tutorials I tried to replace a comma "," by a dot "." with the following instruction

set numvalue=9,23455
set numvalue=%numvalue:,=.%

...but it doesn't work.

You must be doing it within a loop.

pstein
Posts: 125
Joined: 09 Nov 2011 01:42

Re: replacing "," by "." or vice versa not working

#4 Post by pstein » 21 Jan 2015 03:36

After reboot it works now.

Thank you

Squashman
Expert
Posts: 4488
Joined: 23 Dec 2011 13:59

Re: replacing "," by "." or vice versa not working

#5 Post by Squashman » 21 Jan 2015 07:10

pstein wrote:After reboot it works now.

Thank you
First time I have seen a reboot cure a batch file.

Post Reply