Remember to use a batch to help the customer service mm solve the file Matching Problem

Source: Internet
Author: User
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!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.