This Python script reads a text file containing a folder structure and creates the corresponding folders on your file system.
- Reading the Folder Structure: The script reads a text file where each line represents a folder. Indentation indicates the hierarchy.
- Creating Folders: It processes the file to determine the folder structure and creates the folders accordingly.
- Identifying the Executable's Directory: The script identifies the directory where it is located, whether it’s frozen (compiled as an executable) or not.
- Locating
.txt
Files: It searches for.txt
files in the directory. - Choosing a File: If multiple
.txt
files are found, it prompts the user to choose one. If there’s only one, it uses that file directly. - Creating Folder Structure: The script creates the folder structure based on the text file.
- Ensure you have Python 3.x installed on your system. You can download it from the official Python website.
- Install the
folder_structure_creator
package using pip:
pip install folder_structure_creator
- Ensure there is a .txt file with the folder structure in the same directory as the executable.
- Place a text file of the folder structure in the executable's directory or
<user_home_directory>\AppData\Local\Packages\<python_distribution_directory>\LocalCache\local-packages\<python_version>\site-packages\folder_structure_creator
if it was installed with pip. - Run the script.
python fstruct.py
- Follow the prompts if multiple
.txt
files are found.
ParentFolder
ChildFolder1
SubChildFolder1
ChildFolder2
- Python 3.x
- The script can handle both spaces and tabs for indentation.
- Ensure the .txt file with the folder structure is correctly formatted.
This project is licensed under the MIT License - see the LICENSE file for details.