Today, the customer service department's mm found me and asked the following question: there is a column of user phone numbers in the Excel file, and there are a large number of files named after phone numbers in another folder, now we need to match some users' phone number files. There are thousands of files, which are too tired to match ............
I wanted to write ProgramTo solve the problem, and then think about it, it should not be so troublesome. After turning over the help of commands in Windows, you can simply write a line of commands. The specific operations are as follows:
1. First, copy the phone number of the user to be matched and save it as a text file with one line for each number;
2. Enter the following command in Start> running:
For/F "" % I In (d:/phone number .txt) do copy/y D:/data file directory/% I * C:/directory to be copied
3. Complete
Hey! Batch Processing is powerful!
However, I have another question: there are many subdirectories under the directory of the data file. How can I make the files under the subdirectory automatically replicate?
Hey, modify the script:
For/F "" % I In (d:/phone number .txt) Do DIR/B/s d:/data file directory/% I *> D: /example file .txt & for/F "" % I In (d:/example file .txt) do copy % I C:/directory to which you want to copy
Two loops are used.
If you are interested, you can simplify the above script. Please tell me when you think of it. Thank you!