How do I build a batch file at once?

Source: Internet
Author: User
Tags file copy

How can you do this if you're going to use a template file to quickly generate personalized files that are named after hundreds of people across the company? The following small series to tell you how to generate a batch of files, a generation of hundreds of files how to do?

In order to quickly complete a work, the company to carry out full cooperation, the need for each employee to fill out a form in the same format. The Little king of the office is to be made up of an empty table "personal task." DOC, generate a file that is identical to this content on the company's public server, but named after 600 people throughout the company, such as "Zhang Three." DOC "," Dick. DOC "... So that employees do not have to copy and rename directly on the server to fill out their work content.

To accomplish such a batch file generation task, it is obviously inefficient to copy and rename them manually in the resource manager. Finally, Xiao Wang with the company's original personnel record list, with the help of word processing software, quickly completed the company's personnel file establishment.

1, get the Employee Name list

Create a txt text file, such as "Employee list." TXT ". Copy the name of the entire company's employees from the company roster data file into the TXT file.

2, the employee name independently

Xiao Wang found that the name of the employee in the TXT text file is not independent, there is a half-width space between the names, which is not conducive to the following batch, the person's name needs to be displayed independently.

The EmEditor batch substitution method makes it easy to line up each employee's name into a separate line. The way to do this is to open the employee list with EmEditor. TXT, press the shortcut key combination ctrl+h, enter a half-width space in the Find text box, enter a combination of two half-width characters n in the Replace with text box, and then press the Replace All button to complete the branch of the employee's name (Figure 1).

3. Batch Generation Copy command

Our mission is to work from "personal tasks." Doc "generates a standalone DOC file for employees across the company, and we want this to be done automatically by the computer, so it's our job to construct a sequence of commands that automatically copies files."

Now that we have a separate list of employee names, the automatic generation of files can be achieved by adding the following file Copy command on a per-name basis:

COPY Personal work tasks. DOC Zhang Three. DOC

COPY Personal work tasks. DOC Dick. DOC

...... ......

This work is also done in emeditor by the substitution operation. The way to do this is to open the employee list with EmEditor. TXT, press Ctrl+h to enter the replacement window, enter n two half-width characters in the Find text box, and enter ncopy personal work task in the Replace with text box. Doc "(note that both before and after Doc have a half-width space), and then press the Replace All button, then the first line of the manual copy processing, complete the employee name of the branch processing (Figure 2).

4. realize batch file generation

When you are done, you will then list the employees. TXT "and" personal work tasks. DOC "Two files are placed in the same working directory as the server. Put the employee list. TXT "file extension to bat, double-click to run this batch file, you can generate a company-wide independent working file."

Tip: The batch method described above is very efficient for manipulating a large number of files or folders, and the more people, the more files, the higher the efficiency. The above case is only a reference, in fact, the idea of this case is applicable to any template generated by a large number of different names of the occasion. In addition, readers can use this method combined with the Windows Internal DOS command, in the day-to-day operation of the file to play a lot, flexible implementation of file processing and management.

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.