3

I am copying the files from one path to svn working copy by comparing the those 2 folders using beyond compare commandline. Report will get generated after the comparison is done using beyond compare. If any extra files are present in the right side should get deleted from svn repsotiory. So I am using a below for loop to loop through that file. I want to use svn delete for all the right orphaned files in the txt file

FOR /F "tokens=* delims= usebackq" %%x IN (%TEXT_T%) DO (

echo %%x

)

Can you please let me know how can I assign the each line in the txt file and how can I apply svn delete command for that?

Any help would be appreciated

Siddharth Rout
  • 147,039
  • 17
  • 206
  • 250
soni
  • 59
  • 1
  • 2
  • 7
  • 1
    I think you should tag this question with svn, since you would like to use the svn delete command. – steenhulthin Jun 11 '11 at 15:41
  • Can you provide a sample of what the compare commandline tool outputs (what the text file contains)? I assume that `%TEXT_T%` is the compare file. – steenhulthin Jun 11 '11 at 15:53

3 Answers3

3

It sounds like what you really want is just:

FOR /F "tokens=* delims= usebackq" %%x IN (%TEXT_T%) DO (
svn delete %%x
)
steenhulthin
  • 4,553
  • 5
  • 33
  • 52
1

Steenhulthin's answer is correct. @SONI if you want to do it your way (which is a hard way... which is a little funny cause the computer's doing it for you anyways so it's not really hard at all =P ) You can do the following:

SETLOCAL EnableDelayedExpansion
SET count=1
FOR /F "tokens=* delims= usebackq" %%x IN ("%TEXT_T%") DO (
SET var!count!=%%x
SET /a count=!count!+1
)
ENDLOCAL

That way, you'll get

var1 = first string

var2 = second string

so on and so forth.

Anthony Miller
  • 15,101
  • 28
  • 69
  • 98
0

you can set variables as you iterate the loop

ghostdog74
  • 327,991
  • 56
  • 259
  • 343