batch split ; delimited text

April 5, 2011 at 09:03:54
Specs: Windows Vista
how to split the values using the delimeter and loop through each of the values. Like split the following the emails and loop through each one of them.

ex: test@test.com;raj@raj.com;super@super.com

I want to split in batch file and loop through each one of them.


See More: batch split ; delimited text

Report •


#1
April 5, 2011 at 11:09:51
Not clear what's needed.


=====================================
Life is too important to be taken seriously.

M2


Report •

#2
April 6, 2011 at 00:44:08
I used the following code but it does not iterate through all items instead it takes only first mailId.
FOR /F "delims=;" %%a IN ("test@test.com;raj@raj.com;super@super.com") DO @ECHO %%a

output is
test@test.com

The desired output is
test@test.com
raj@raj.com
super@super.com

I think I need to just modify this code in order to make it iterate through all items not just first one.
Any help would be greatly appreciated. Thanks in advance.


Report •

#3
April 6, 2011 at 02:10:33
Perhaps:

set list=test@test.com;raj@raj.com;super@super.com
for %%a in ("%list:;=","%") do echo %%~a


Report •
Related Solutions


Ask Question