From 8d0b3145ea4d04d10ab216c70d91801d9f4dc3a9 Mon Sep 17 00:00:00 2001 From: Ville Rantanen Date: Tue, 20 Apr 2021 18:41:22 +0300 Subject: [PATCH] pad folder names --- files/FolderSplit.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/files/FolderSplit.py b/files/FolderSplit.py index dbe810b..9865ce3 100755 --- a/files/FolderSplit.py +++ b/files/FolderSplit.py @@ -190,8 +190,9 @@ if method == "regexp": (outFolders, uniqlabel, matcher) = regexmatches(inFiles, options) input("correct?") else: + padding = "{:0" + str(len(str(options.n))) + "d}" for x in range(options.n): - outFolders.append(os.path.join(options.path, "folder" + str(x + 1))) + outFolders.append(os.path.join(options.path, ("folder-" + padding).format(x + 1))) for x in outFolders: if not os.path.isdir(x):