I have two text files - sample1.txt and sample2.txt which contains path of moving the files from sample1 to sample2. To make it more clear. I have these two files:
Sample1.txt
C:\Users\borkarv\Desktop\Sample\ABC\New Text Document.txt C:\Users\borkarv\Desktop\Sample\ABC\sdfsdf .txt
C:\Users\borkarv\Desktop\Sample\XYZ\New Text Document.txt C:\Users\borkarv\Desktop\Sample\OPQ\asdasd.txt
C:\Users\borkarv\Desktop\Sample\OPQ\New Text Document.txt
Sample2.txt
C:\Users\borkarv\Desktop\Sample\ABC\Backup\New Text Document.txt C:\Users\borkarv\Desktop\Sample\ABC\Backup\sdfsdf .txt C:\Users\borkarv\Desktop\Sample\XYZ\Backup\New Text Document.txt C:\Users\borkarv\Desktop\Sample\OPQ\Backup\asdasd.txt C:\Users\borkarv\Desktop\Sample\OPQ\Backup\New Text Document.txt
I want to move all the files from sample1.txt to sample2.txt such that path1 from sample1.txt goes in path1 of sample2.txt and so on.
I tried to use two for loops for this but that creates a problem as the files get overwritted.
FOR /F "delims=/" %%x in (sample1.txt) DO ^
FOR /F "delims=/" %%y in (sample2.txt) DO ^
move "%%x" "%%y"
I was thinking of putting && in between the 2 for loops but that doesnt work.