Home >Topics >excel >Practical Excel skills sharing: Quickly create folders in batches!

Practical Excel skills sharing: Quickly create folders in batches!

青灯夜游
青灯夜游forward
2023-02-23 19:18:436317browse

Creating one folder is a trivial matter; creating ten folders is completed quickly; creating 171 folders is a big project. If batch creation is not possible, it would be good if it can be completed in 2 hours. This article will introduce to you how to use Excel to create folders in batches. I hope it will be helpful to you!

Practical Excel skills sharing: Quickly create folders in batches!

# After receiving a small request from the leader, create a folder according to the directory in the picture below. The editor silently counted and found that almost 171 folders need to be created. A small task can become a large project in seconds.

Practical Excel skills sharing: Quickly create folders in batches!

So, what should you do if you encounter such a large folder project? The answer is to use the MD command for batch processing.

1. Know the MD command

Md (make directory) is a command used to create a directory in the DOS operating system. The Md command can be used to create multi-level directories.

Format: md [path] directory 1 directory 2 directory 3...

Let’s test whether MD can really create multi-level directories.

Step one: Press the WIN R key on the keyboard, enter CMD, and then press the Enter key to open our DOS window.

Practical Excel skills sharing: Quickly create folders in batches!

Step 2: Enter the MD command, then press the space bar, and then enter the multi-level directory "Directory 1 Directory 2 Directory 3 Directory 4". After completing the input, press the Enter key to execute the DOS command.

Practical Excel skills sharing: Quickly create folders in batches!

Go to the C:UsersAdministrator folder and the newly created multi-level folder already exists, perfect!

Practical Excel skills sharing: Quickly create folders in batches!

If we can create MD commands in batches and then copy and paste them into the DOS window, we can solve the need to create a large number of folders.

2. Use EXCEL to batch generate MD folder creation text

Practical Excel skills sharing: Quickly create folders in batches!

Step 1: In EXCEL according to the leadership requirements, Organize folder names according to the levels of first-level directory, second-level directory, and third-level directory. If you need to create a folder, enter 1 in the corresponding cell; if you do not need to create a folder, enter 0 in the corresponding cell. For example: first and second graders of information technology do not need to create folders, just enter 0 in the corresponding cells.

Practical Excel skills sharing: Quickly create folders in batches!

Step 2: Save the newly created EXCEL file.

Step 3: Perform unpivot operation on the data area.

(1) Create a new worksheet.

(2) Select the "Data" tab, and then select "New Query" -> "From File" -> "From Workbook".

Practical Excel skills sharing: Quickly create folders in batches!

(3) Select the EXCEL file saved above and click the "Import" button

Practical Excel skills sharing: Quickly create folders in batches!

(4) Select Select the worksheet where the data is located, sheet1, and click the "Edit" button.

Practical Excel skills sharing: Quickly create folders in batches!

(5) Hold down the Shift key to select the 4 columns of data for first grade, second grade, third grade, and fourth grade, right-click and select "Inverse Pivot Column".

Practical Excel skills sharing: Quickly create folders in batches!

(6) Select "Close and Upload".

Practical Excel skills sharing: Quickly create folders in batches!

Practical Excel skills sharing: Quickly create folders in batches!

(7) Next, you only need to perform string concatenation. Enter the formula in F2:

="MD "&A2&""&B2&""&C2&""&D2

Then fill in the formula downwards to get the command line for MD to create all folders.

Practical Excel skills sharing: Quickly create folders in batches!

3. Complete the batch creation of folders

(1) Copy all the concatenated strings in column F.

(2) Return to the DOS operation window , paste into the DOS window.

Note: You cannot directly press Ctrl V to paste, but you should right-click the mouse and select the "Paste" command to paste.

Practical Excel skills sharing: Quickly create folders in batches!

Folders have been created in batches, as follows.

Practical Excel skills sharing: Quickly create folders in batches!

Postscript:

Some partners may ask: What should I do if I need to create a folder under the F drive?

Simple, in the DOS window, first enter "F:" and press Enter to enter the root directory of the F drive, then follow the above operation and copy and paste.

My partner continued to ask: I need to create a folder under the "Teaching" folder on the D drive, and I don't want to enter DOS commands. What should I do?

is also very simple! Create a new text file through Notepad, and copy and paste the MD command string prepared above into the text file.

Practical Excel skills sharing: Quickly create folders in batches!

Then save the text file. After saving, right-click the file and select "Rename" to modify the file extension from .txt to .bat. The bat file is a batch file.

Next, put the file with the modified suffix where you need to create a folder, double-click it to generate folders in batches. For example, if you place it in the root directory of drive F, folders will be generated in batches in the root directory of drive F; if you place it in the "Teaching" folder of drive D, you will be able to batch generate folders in the "Teaching" folder.

Related learning recommendations: excel tutorial

The above is the detailed content of Practical Excel skills sharing: Quickly create folders in batches!. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:itblw.com. If there is any infringement, please contact admin@php.cn delete