Add File Name Prefix Advanced:
The Add File Name Prefix Advanced node is designed to enhance file management by allowing you to dynamically add prefixes to file names within a specified path. This node is particularly useful for organizing files systematically by incorporating additional information such as custom prefixes and timestamps. By offering the flexibility to include date and time in various formats, either as a prefix or postfix, it ensures that file names are not only unique but also informative. This capability is essential for maintaining an organized file structure, especially in environments where files are frequently generated or modified. The node's advanced features make it a powerful tool for users who need to automate file naming conventions, thereby saving time and reducing the risk of errors associated with manual file management.
Add File Name Prefix Advanced Input Parameters:
path
The path parameter specifies the directory path where the file is located. It is crucial as it determines the location where the new file name with the prefix will be applied. This parameter does not have a default value and must be provided to ensure the node functions correctly.
file_name_prefix
The file_name_prefix parameter allows you to define a custom string that will be added as a prefix to the file name. This can be any string that helps in identifying or categorizing the file. The default value is an empty string, meaning no prefix will be added unless specified.
add_date_time
The add_date_time parameter provides options to include the current date and time in the file name. You can choose from "disable" (no date/time added), "prefix" (date/time added before the file name), or "postfix" (date/time added after the file name). This feature is useful for timestamping files, ensuring they are easily sortable and identifiable. The default setting is "disable".
date_time_format
The date_time_format parameter allows you to specify the format in which the date and time should appear in the file name. It uses standard Python datetime format codes, with the default being "%Y_%m_%d_%H:%M:%S". This flexibility ensures that the date and time can be formatted to meet specific organizational standards or personal preferences.
input_variables
The input_variables parameter is optional and allows for additional dynamic content to be included in the file name prefix. This can be any variable data that needs to be formatted into the prefix, providing further customization and automation capabilities.
Add File Name Prefix Advanced Output Parameters:
STRING
The output is a STRING that represents the new file path with the added prefix. This output is crucial as it provides the complete path to the file with its newly formatted name, ensuring that subsequent processes or users can easily locate and utilize the file.
Add File Name Prefix Advanced Usage Tips:
- Use the
file_name_prefixto categorize files by project, type, or any other identifier that makes sense for your workflow. - Enable
add_date_timewith the "prefix" or "postfix" option to automatically timestamp files, which is particularly useful for version control or tracking changes over time. - Customize the
date_time_formatto match your organization's date and time standards, ensuring consistency across all file names.
Add File Name Prefix Advanced Common Errors and Solutions:
Invalid path
- Explanation: The specified path does not exist or is incorrect.
- Solution: Double-check the path for typos or errors and ensure that the directory exists.
Unsupported date_time_format
- Explanation: The date and time format string is not valid.
- Solution: Refer to Python's datetime format codes and ensure the format string is correctly specified.
Missing file_name_prefix
- Explanation: No prefix is provided, resulting in no change to the file name.
- Solution: Ensure that a meaningful prefix is specified to take advantage of the node's capabilities.
