cm_CreateNewFiles: create new files and folders FROM LIST in the current active panel

Here you can propose new features, make suggestions etc.

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
Stefan2
Power Member
Power Member
Posts: 4159
Joined: 2007-09-13, 22:20 UTC
Location: Europa

cm_CreateNewFiles: create new files and folders FROM LIST in the current active panel

Post by *Stefan2 »

Hello Christian,

I would like to suggest this new feature: cm_CreateNewFiles


This feature should
- open an defined text editor (best separate from F4, maybe as default just Notepad?)
with an CreateNewFiles.txt file in the TC folder.

A good text editor like Notepad2 or Notepad++ already have all need features to create or manipulate the below mentioned users' list.


The user
- write files and folders to create, each on an own line, folders must have an trailing backslash
my new file.txt
another new file
Test file.png
Test file.jpg
My New Folder\
Test Folder\Sub folder\
Test Folder\Sub folder in name but i am a file
Test Folder 2\Sub folder\my new file.txt
C:\Users\userX\music collection\Rock\Queen - Another one bites the dust.mp5
C:\Users\userX\music collection\Rock\Queen - Bohemian Rhapsody.mp5
C:\Users\userX\music collection\Rock\Queen - Don't Stop Me Now.mp5
C:\Users\userX\music collection\Rock\Queen - I Want to Break Free.mp5
- save the file


Then this feature should
- check the list for invalid signs
(ask the user to modify, like """invalid signs <>:? found, please adjust""" and open the list again, or just exchange automatically with underscores)
- ask the user if sure to create now xxx files in folder xxxx or if he want to cancel here.
- create the files and folders in the current active panel while asking to overwrite or not to overwrite on already existing files


Keep that CreateNewFiles.txt file with its content and reuse it for next use,
also nice to use for an user own undo task (like copy content to clipboard and then SelectFromClipboard).


Great for to re-create a list of files or a whole folder-hierarchy posted by an user for to inspect his problem/need.







 
User avatar
Stefan2
Power Member
Power Member
Posts: 4159
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: cm_CreateNewFiles: create new files and folders FROM LIST in the current active panel

Post by *Stefan2 »

What is about this above idea? :D

Me think this is much more simple to handle then the >>>cm_Edit /CN="new file1.txt|new file2.txt|new file3.txt"L0<<< approach.

Just open the set editor (or a own big edit box),
write or paste in multiple lines of file names or paths,
new file1.txt
new file2.txt
new file3.txt
New Folder\
Another Folder\sub folder\file.ext

click [OK] and done.


:?:



 
User avatar
petermad
Power Member
Power Member
Posts: 14814
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: cm_CreateNewFiles: create new files and folders FROM LIST in the current active panel

Post by *petermad »

Or maybe add an extra parameter to cm_Edit - like: @="filelist.txt"

That doesn't need translation and could therefore be incorporated in TC 11.00
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
Stefan2
Power Member
Power Member
Posts: 4159
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: cm_CreateNewFiles: create new files and folders FROM LIST in the current active panel

Post by *Stefan2 »

petermad wrote: 2023-07-06, 23:04 UTC Or maybe add an extra parameter to cm_Edit - like: @="filelist.txt"

That doesn't need translation and could therefore be incorporated in TC 11.00

A possibility too. But need a quick and hassle free option to access the "filelist.txt" for editing.


CMD: cm_Edit
PARAM: /@="filelist.txt"
PARAM: /@="path\filelist.txt"
PARAM: /@="%P%N"
PARAM: /@ (default to a fix named "filelist.txt" in TC-folder)

Defaults:
- LØ
- Without the /G = show the name of the list for verifying
- With /G = just create silently

- And an trailing backslash after an name in the list should create an folder


I just tried with
/CN="new folder\"
f.ex. doesn't work.
So "cm_Edit" is for files only and couldn't be a possibility for my suggestion?





 
 
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48096
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: cm_CreateNewFiles: create new files and folders FROM LIST in the current active panel

Post by *ghisler(Author) »

When you already have a list of names, what stops you from putting
echo . >
or
mkdir
in front of each and renaming the file to listname.bat?
Author of Total Commander
https://www.ghisler.com
User avatar
Stefan2
Power Member
Power Member
Posts: 4159
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: cm_CreateNewFiles: create new files and folders FROM LIST in the current active panel

Post by *Stefan2 »

ghisler(Author) wrote: 2023-07-09, 06:25 UTC When you already have a list of names, what stops you from putting
echo . >
or
mkdir
in front of each and renaming the file to listname.bat?

Going through a list with one dozen or maybe even hundred of lines and prefix each line with the correct command?

Then I also could just us one of my many scripts (MS-DOS Batch, AutoHotkey, VBS, JS, PowerShell)
which can already be found on this forum and pass the list as argument.


But it's is not me, it's about a basic command each file manager should have IMHO,
for the "average user" to quickly create some dummy files or even whole folder hierarchies.

I want to tell a user to just execute cm_CreateNewFiles, let him fill in the list with items and click [OK]

Scripts we can use for more difficult tasks.



 
JOUBE
Power Member
Power Member
Posts: 1482
Joined: 2004-07-08, 08:58 UTC

Re: cm_CreateNewFiles: create new files and folders FROM LIST in the current active panel

Post by *JOUBE »

But the truth is nobody will use iall the new functions because you have to study the manual for the details. It is easier to edit all that things simply in a list file with an editor of your choice... IMHO
Post Reply