I have a little question.
ı want string split with cmd.
Example :
emre;bahadir;131213034;computer
i want to
var1=emre
var2=bahadir
var3=131213034
var4=computer
please help me ! :)
I have a little question.
ı want string split with cmd.
Example :
emre;bahadir;131213034;computer
i want to
var1=emre
var2=bahadir
var3=131213034
var4=computer
please help me ! :)
Just use a regular FOR
loop
@Echo OFF
Set "str=emre;bahadir;131213034;computer"
For %%_ In (%str%) DO (
echo %%_
)
Pause&Exit /B 0
basically the same as ElektroStudios' answer, but expanded with a counter to set the variables:
setlocal enabledelayedexpansion
set "str=emre;bahadir;131213034;computer"
set x=0
For %%a In (%str%) DO (
set /a x+=1
set "var!x!=%%a"
)
set var