trim or something? [solved]

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
dwngrt
Posts: 26
Joined: 07 Oct 2013 05:14
Location: The Netherlands

trim or something? [solved]

#1 Post by dwngrt » 13 Oct 2013 12:58

Hello dear people,

For a while i am working on a batch chat over LAN.
It is fully working, now i am just messing around with the fine tuning.
I got it so far to change the color in the main screen and in the chat reader screen,
i now want to be able to adjust the refresh speed of the reader screen (as i must be working with 2 batch scripts for this chat thingy).
and i want it to be done simply as: /refresh {seconds}

the thing is, i need to output the seconds, and not the /refresh, so how do i get only the seconds to write to a file?
i can recall something with trim but i'm not sure about that.

penpen
Expert
Posts: 2009
Joined: 23 Jun 2013 06:15
Location: Germany

Re: trim or something? [solved]

#2 Post by penpen » 14 Oct 2013 03:42

If you need parameter parsing, and you don't have poison charactersm then this may help you:

Code: Select all

set "secs=%*"
set "secs=%secs:*/refresh=%"
for /F %%a in ("%secs%") do set "secs=%%a"

penpen

Post Reply