Please assist me in evaluating whether I can use Take Command to solve the following problem using DOS Batch (BAT) files.
I have a directory tree as show below containing four files of same name index.txt.
The goal is to read each line in the first file c:\index.txt to obtain the next directory path that points to the next index.txt file and repeat until all index.txt files are found empty. Next, create a file named ListFile.txt containing all directory paths found but in the reverse order as follows:
C:\b\index.txt
C:\b\c\index.txt
C:\a\index.txt
C:\index
Note: c:\b\c\index.txt is in the directory tree twice and should not be appear twice in the Listfile.txt file.
Do not assume any restrictions on the depth of the directory tree or number of entries in a given index.txt files.
I have a directory tree as show below containing four files of same name index.txt.
The goal is to read each line in the first file c:\index.txt to obtain the next directory path that points to the next index.txt file and repeat until all index.txt files are found empty. Next, create a file named ListFile.txt containing all directory paths found but in the reverse order as follows:
C:\b\index.txt
C:\b\c\index.txt
C:\a\index.txt
C:\index
Note: c:\b\c\index.txt is in the directory tree twice and should not be appear twice in the Listfile.txt file.
Code:
+-------- c:\b\index.txt ---< --- empty
|
+---------- c:\a\index.txt ---+
| |
C:\index.txt + +--------- c:\b\c\index.txt ---< --- empty
|
+----------- c:\b\c\index.txt ---empty
Do not assume any restrictions on the depth of the directory tree or number of entries in a given index.txt files.