如果您有一个电子表格并想从Excel电子表格的值(Excel)创建多个文件夹(create multiple folders),您可以按照本教程进行操作。无论您使用Excel桌面应用程序、Excel Online还是Google 表格(Google Sheets),您都可以使用本教程获得相同的结果。
假设您在Excel电子表格中有一个名称列表以及一些其他数据。同时,您希望在列中提到的每个名称之后创建文件夹。您可以使用一种简单的方法从Excel(Excel)单元格值一次创建多个文件夹,而不是手动创建它们,这非常耗时。由于您的计算机上已经有记事本(Notepad)应用程序,因此您不需要其他任何东西来完成工作。
在开始之前,您应该知道一些必须清除的事情。假设您有一个包含三列五行的电子表格。如果你按照这个方法,你最终会创建五个文件夹,每个文件夹将包含两个子文件夹。可以添加或删除更多子文件夹,但这需要手动操作。
我们在演示电子表格中展示了这些步骤。换句话说,我们提到了 A 列(Column A)、B 列等以简化步骤。但是,您需要根据电子表格在特定列/行/单元格中执行相同操作。根据以下指南,B 列(Column B)将是主文件夹,C 列(Column C)、D 列等将是子文件夹。
如何从Excel(Excel)一次创建多个文件夹
要从Excel一次创建多个文件夹,请按照以下步骤操作 -
- 打开 Excel 电子表格。
- 右键单击A 列(Column A)并选择插入(Insert)选项。
- 在所有单元格中输入MD 。
- 在除A 列(Column A)和 B列 \之外的所有单元格中作为前缀输入。
- 选择(Select)所有单元格并将它们粘贴到记事本(Notepad)中。
- 选择所有 C、D 或其余列之前可见的空格和组合。
- 转到Edit > Replace。
- 在查找内容(Find what)框中输入复制的内容。
- 在替换为(Replace with)框中输入。
- 单击全部替换(Replace All)按钮。
- 转到 File > Save As。
- 选择路径,输入带有.bat扩展名的名称,然后单击保存(Save)按钮。
- 将 .bat 文件移动到要创建所有文件夹的位置。
- 双击它。
让我们详细检查这些步骤。
首先,打开您的Excel电子表格。但是,由于您将对原始电子表格进行一些更改,因此建议您制作此工作表的副本。
打开后,您必须在开头输入一个新列。为此,右键单击现有的 A 列(Column A)并选择 插入 (Insert )选项。
现在, 在 A 列的所有单元格中输入MD 。
接下来,您必须在C 列(Column C)、D 列以及您要包括的所有其他列的所有单元格中输入 ' \’ 作为前缀。为此,您可以按照此详细指南 在 Excel 的所有单元格中输入前缀。
然后,复制所有单元格,打开记事本(Notepad)应用程序并将其粘贴到那里。您必须删除B 列(Column B)和 C 列之间的空间,依此类推。为此,复制包含空格的部分并\ > 转到 Edit > Replace,然后将其粘贴到 Find what 框中。
进入 \ 在 替换为 (Replace with )框中,然后单击 全部替换 (Replace All )按钮。
现在,您可以找到这样的条目-
单击“ File > Save As ”选项,选择要保存文件的路径,输入带有 .bat 扩展名的名称(例如,myfolders.bat),然后单击“ 保存 (Save )”按钮。
现在,将 .bat 文件移动到要创建所有文件夹的位置并双击它。根据您选择的单元格数量,完成工作可能需要 10-15 秒。
就这样!如果您对评论有任何疑问,请告诉我们。
相关(Related): 如何在 Windows 中一次创建多个文件夹(How to create multiple folders at once in Windows)。
How to create multiple folders at once from Excel
If yоu have a spreadsheet and want to create multiple folders from the Excel spreadsheet’s values, you can follow this tutorial. Whether you use the Excel desktop app, Excel Online, or Google Sheets, you can use this tutorial to get the same results.
Let’s assume that you have a list of names alongside some other data in an Excel spreadsheet. Meanwhile, you want to make folders after each name mentioned in a column. Instead of creating them manually, which is very time-consuming, you can use a simple method to create multiple folders at once from Excel cell values. As you already have the Notepad app on your computer, you do not need anything else to get the job done.
Before getting started, you should know a few things that must be cleared. Let’s say you have a spreadsheet containing three columns and five rows. If you follow this method, you will end up creating five folders, and each folder will contain two sub-folders. It is possible to add or remove more sub-folders, but that requires manual work.
We have shown the steps in a demo spreadsheet. In other words, we have mentioned Column A, B, and so on to simplify the steps. However, you need to do the same in a specific column/row/cell according to your spreadsheet. As per this following guide, Column B will be the primary folder, and Column C, D, etc., will be sub-folders.
How to create multiple folders at once from Excel
To create multiple folders at once from Excel, follow these steps-
- Open the Excel spreadsheet.
- Right-click on Column A and select the Insert option.
- Enter MD in all cells.
- Enter \ as a prefix in all cells except Column A and B.
- Select all cells and paste them into Notepad.
- Select space and \ combination visible before all the C, D, or rest of the columns.
- Go to Edit > Replace.
- Enter the copied content in the Find what box.
- Enter \ in the Replace with box.
- Click the Replace All button.
- Go to File > Save As.
- Select a path, enter a name with .bat extension, and click the Save button.
- Move the .bat file to a place where you want to create all folders.
- Double-click on it.
Let’s check out these steps in detail.
At first, open your Excel spreadsheet. However, it is recommended to make a copy of this sheet as you are going to make a few changes to the original spreadsheet.
After opening, you have to enter a new column in the beginning. For that, right-click on the existing Column A and select the Insert option.
Now, enter MD in all the cells in Column A.
Next, you have to enter ‘\’ as the prefix in all cells of Column C, D, and all the other columns that you want to include. For that, you can follow this detailed guide to enter prefixes in all cells in Excel.
Then, copy all the cells, open the Notepad app, and paste it there. You have to remove the space between Column B and C, and so forth. For that, copy the portion containing the space and \ > go to Edit > Replace, and paste it in the Find what box.
Enter \ in the Replace with box, and click the Replace All button.
Now, you can find the entries like this-
Click the File > Save As option, choose a path where you want to save the file, enter a name with .bat extension (for example, myfolders.bat), and click the Save button.
Now, move the .bat file to a location where you want to create all the folders and double-click on it. Depending upon how many cells you selected, it might take 10-15 seconds to get the job done.
That’s all! Do let us know if you have any doubt in the comments.
Related: How to create multiple folders at once in Windows.