Text2Folder: Creating folders (and subfolders) from a list

A collection of especially useful xplorer² topics and ideas. New users may find it helpful to look here before searching the other forums for information. >>>>>> Please post new material in the relevant forum. (New stuff posted here will be removed.) Thanks. -fg-

Moderators: fgagnon, nikos

Post Reply
narayan
Platinum Member
Platinum Member
Posts: 1430
Joined: 2002 Jun 04, 07:01

Text2Folder: Creating folders (and subfolders) from a list

Post by narayan » 2012 Sep 14, 06:17

x2 has a facility to create a new (empty) folder by pressing F8.
(Or, use the Actions>New Folder menu option).

But it cannot create multiple folders (or their subfolders) at a time.
This can be done with a small utility called Text2Folders

This article explains how to use the utility:

1. Follow the link above and download the utility.
2. Unzip the two files and place them in any installation folder.
3. To run the application, double-click on the exe file.

The application works in two steps. Each step has further two options:
1. Specify where you want to create the folders (and optionally, subfolders).
   (either paste a path in the box, or browse to the target folder)
2. Provide the names of the folders (and optionally, subfolders).
  (either specify a text file that has these names; or type the names in a multi-line box, using a separate line for each name)

To create subfolders, use relative paths with backslashes (\).
For example, the following list-
Folder1
Folder1\Subfolder1_1
Folder1\Subfolder1_2
Folder2
Folder2\Subfolder2_1
Folder2\Subfolder2_2
-will create two folders in the current folder, called Folder1 and Folder2. Then it will create two subfolders in each of these folders.

The Text2Folders utility also has a commandline mode, as explained below:

If your folders are likely to have spaces in their names, then use-
> AbsolutePathForText2Folders.exe "$P" "$F"

If you don't want to use a text file with the list of folders, then use-
> AbsolutePathForText2Folders.exe "$P"

NOTE: In the above commands, replace "AbsolutePathFor" with the absolute path of the Text2Folders executable. In case the path has any spaces, enclose the entire path in double quotes " ".

For example,
> "D:\Util\Folder applications\Text2Folders.exe" "$P" "$F"

Hint:
Use the Customize>User Commands>Organize... menu option to-
1. Apply a custom icon and place it on the toolbar.
2. Apply a keyboard shortcut

Thanks to Trollpk for providing the inputs.

Gary M. Mugford
Bronze Member
Bronze Member
Posts: 145
Joined: 2009 Oct 14, 00:54
Location: Brampton ON Canada

Post by Gary M. Mugford » 2012 Sep 29, 22:47

Thanks for the tip. I start a project for programming by creating some cleverly named folder (Gary'sTest#1 for example) and then immediately create Data, Proj and Rez subfolders. A bit boring and certainly not time-consuming. But it's awfully nice to have a one click solution that takes a single name and creates my preferred sub-structure.

User avatar
fgagnon
Site Admin
Site Admin
Posts: 3737
Joined: 2003 Sep 08, 19:56
Location: Springfield

Post by fgagnon » 2012 Sep 30, 00:56

Assuming you already have the folder structure as an example (even if it's populated with content, such as from an existing project) you can easily duplicate the structure elsewhere without going to the trouble of making a list.  Just use the built-in x2 feature
  • Edit > Paste special > Folder structure
This often-overlooked facility has been part of x2 for years.

Gary M. Mugford
Bronze Member
Bronze Member
Posts: 145
Joined: 2009 Oct 14, 00:54
Location: Brampton ON Canada

Post by Gary M. Mugford » 2012 Sep 30, 02:36

Indeed, I did miss the paste structure command. Interesting. That said, I've already set up the method outlined above and it works. Click on the MyStuff folder, click on the little button with the plus sign, Big F and little F and automagically, It asks for a name and then I'm done. Took doing the customization and creating a text file with the three sub-folders. Done. With Paste Structure, I would have to click on another project, copy its structure and then paste structure into the folder I just created with F8 and named. Laziness is not a virtue, but I'm not a virtuous man.

Still, it's a trick worth remembering for other situations without previously set up parameters. Thanks.

Post Reply