I’m trying to clean up some old data for a friend. The data is placed is multiple folders like the following.
- C:\Tally\Data\0000
- D:\Tally\Data\1092
- C:\New folder\Tally7.2\Data\0001
Now, I’ve used a regular expression ^[0-9][0-9][0-9][0-9]$ with a search engine called Everything to find all the possible folders with four digit names like 0000 which I’ve exported to a text file containing a single directory path on every line, surrounded by double quotes on both sides.
I need to write a batch script to do the following.
- Read the text file line by line.
- Check if a folder with that name already exists in the destination directory.
- If yes, then rename the folder and copy it.
- If not, copy without renaming the folder.
- Finally, I want to sequentially rename all the folders in the destination starting with 0000.
How can I accomplish this?
1 Answer