Nested For loop giving problem

February 3, 2010 at 10:09:59
Specs: Windows XP

I am having problem's while running nested for loop.
I have a many files*.csv in a folder.There are pair of files which are identical .I mean like exp_1_2 and _exp_1_2.So i need to find each pair and check whether they are same or not.So i am using fc command.

But the problem is here always it displays one file in the _exp_log.txt file only.I wnat to know why not taking all the files which are in the folder.

My bat code is like this

For %%x in (exp_*.csv) do (
For %%y in (_exp_*.csv) do (
set string1=%%y
if %%x==%string1:~1,22% fc %%x %string1:~1,22% >>_exp_log.txt

Can somebody tell me whats wrong with the code.

See More: Nested For loop giving problem

Report •

February 3, 2010 at 10:20:56
Try starting with:

setLocal enableDELAYedeXpansion

then use:


Helping others achieve escape felicity


Report •
Related Solutions

Ask Question