How can I make empty directories from a text file.
Moderators: Hacker, petermad, Stefan2, white
How can I make empty directories from a text file.
Hi :
Is there a way to make empty directories from a text file?
For example I have a text file with a list of empty directories to be created with total commander.
This is just an example of text file.
ListDir.txt:
-----------------
Books
Programs
Personal Info
Tools
Music
Microsoft
blabla
.
.
--------------------
Is there a way to make empty directories from a text file?
For example I have a text file with a list of empty directories to be created with total commander.
This is just an example of text file.
ListDir.txt:
-----------------
Books
Programs
Personal Info
Tools
Music
Microsoft
blabla
.
.
--------------------
1. Create a text file with the following content:
Edit: Corrected!
2. Save it as "mkdirsfromlistdir.cmd" in Windows Folder.
3. Create a button with the following command:
Drag&drop the file ListDir.txt to the button and the directories will be created. "skip=2" in the above example are the lines that are ignored in the text file so you need to adjust it if your directories don't start in line 3.
Icfu
Edit: Corrected!
Code: Select all
for /f "skip=2 delims=" %%a in (%1) do md "%%a"
3. Create a button with the following command:
Code: Select all
mkdirsfromlistdir.cmd
Icfu
Last edited by icfu on 2005-02-06, 16:45 UTC, edited 1 time in total.
This account is for sale
Hi
There is a german PlugIn for Speedcommander called "CreateFolder".
Look at
http://forum.speedproject.de/showthread.php?s=&threadid=2660.
Use UnSqueez to extract the sqx archive.
You have to embed the tool into TC via menu "Start/Change Startmenu".
Enter the Path to CF as "Command" and %p as parameter.
Rename the ending of your textfile to .clf and put it into the same dir als CF.
Now you can load the textfile with the "Favoriten" button of CF.
You can even scan an existing folder structure and save it as a favorite.
regards
chiron
There is a german PlugIn for Speedcommander called "CreateFolder".
Look at
http://forum.speedproject.de/showthread.php?s=&threadid=2660.
Use UnSqueez to extract the sqx archive.
You have to embed the tool into TC via menu "Start/Change Startmenu".
Enter the Path to CF as "Command" and %p as parameter.
Rename the ending of your textfile to .clf and put it into the same dir als CF.
Now you can load the textfile with the "Favoriten" button of CF.
You can even scan an existing folder structure and save it as a favorite.
regards
chiron
@tony01:
Maybe you have created the button by dragging & dropping the mkdirsfromlistdir.cmd on the button bar? Then you will have a superfluous entry in the button "start path" which creates the folders in the folder where the "mkdirsfromlistdir.cmd" resides in. Delete the start path then!
Besides that: This example is made for dragging & dropping ListDir.txt (or any other file, it doesn't matter how you have named it) on a button with the mentioned command. It doesn't work when you just "run" the command or press the button with ListDir.txt marked. If you want other solutions just tell me. You can also have the folder creation started without dragging&dropping, I just need more input what exactly fits best for you...
So, please follow the guidelines and it WILL work!
If it still doesn't work you are probably using Windows 98 or some other non NT system where not only the /f parameter is not supported but also the .cmd file extension can't be excecuted but only .bat.
Icfu
Maybe you have created the button by dragging & dropping the mkdirsfromlistdir.cmd on the button bar? Then you will have a superfluous entry in the button "start path" which creates the folders in the folder where the "mkdirsfromlistdir.cmd" resides in. Delete the start path then!
Besides that: This example is made for dragging & dropping ListDir.txt (or any other file, it doesn't matter how you have named it) on a button with the mentioned command. It doesn't work when you just "run" the command or press the button with ListDir.txt marked. If you want other solutions just tell me. You can also have the folder creation started without dragging&dropping, I just need more input what exactly fits best for you...

So, please follow the guidelines and it WILL work!
If it still doesn't work you are probably using Windows 98 or some other non NT system where not only the /f parameter is not supported but also the .cmd file extension can't be excecuted but only .bat.
Icfu
This account is for sale
@icfu:
I remove the superfluous entry in the button "start path" and I doesn't works properly.
This is my example :
This is the text file:
---------------------
Addison.Wesley.Professional.Effective.Enterprise.Java.Aug.2004
Addison.Wesley.Text.Processing.In.Python
Addison Wesley - Web Hacking - Attacks and Defense
Addison Wesley Just Java 2.6th Ed
Adobe.Acrobat.6.PDF.For.Dummies
Algorithms for Programmers
and this is the Empty Directories that It has been created (Result):
------------------------------------------------------------------------
Addison
Addison.Wesley.Professional.Effective.Enterprise.Java.Aug.2004
Addison.Wesley.Text.Processing.In.Python
Adobe.Acrobat.6.PDF.For.Dummies
Algorithms
Only 3 empty dir are correct, the rest I don't know what happend.
I remove the superfluous entry in the button "start path" and I doesn't works properly.
This is my example :
This is the text file:
---------------------
Addison.Wesley.Professional.Effective.Enterprise.Java.Aug.2004
Addison.Wesley.Text.Processing.In.Python
Addison Wesley - Web Hacking - Attacks and Defense
Addison Wesley Just Java 2.6th Ed
Adobe.Acrobat.6.PDF.For.Dummies
Algorithms for Programmers
and this is the Empty Directories that It has been created (Result):
------------------------------------------------------------------------
Addison
Addison.Wesley.Professional.Effective.Enterprise.Java.Aug.2004
Addison.Wesley.Text.Processing.In.Python
Adobe.Acrobat.6.PDF.For.Dummies
Algorithms
Only 3 empty dir are correct, the rest I don't know what happend.
Yep, I forgot the possibility of spaces in the file names when posting the code, sorry... 
So, please change the mkdirsfromlistdir.cmd file to the following:
Icfu

So, please change the mkdirsfromlistdir.cmd file to the following:
Code: Select all
for /f "skip=2 delims=" %%a in (%1) do md "%%a"
This account is for sale
Re: How can I make empty directories from a text file.
the other way (except tc)tony01 wrote:Hi :
Is there a way to make empty directories from a text file?...
ListDir.txt:
-----------------
Books
Programs
Personal Info
Tools
Music
Microsoft
blabla
.
--------------------
1)open your text file with a "text editor" that supports column mode (ultra edit, textpad, pseditor)
2)add "md " (be carefull space) every start of lines (it is very easy using column mode. in ultra edit: column menu/insert_fill column)
3) save your text file as blahblah.BAT into where you want to create the a lot of directories.
4) run blahblah.BAT (enter, double click, whatever)
It's not the other way but the same say only by manually editing.
Manually editing a file, entering md in each line (for which you need an advanced text editor which you have to start, too, and afterwards even saving it as a batch file and starting it is definetely not faster but slower than dragging&dropping to a button or even just pressing a button, that's rather obvious. How can you tell me that this could be faster?
There is nothing against the manual way when there are five lines in the batch file only but as soon as the file gets bigger you will feel like that a robot could do that stupid work much faster.
Icfu
Manually editing a file, entering md in each line (for which you need an advanced text editor which you have to start, too, and afterwards even saving it as a batch file and starting it is definetely not faster but slower than dragging&dropping to a button or even just pressing a button, that's rather obvious. How can you tell me that this could be faster?
There is nothing against the manual way when there are five lines in the batch file only but as soon as the file gets bigger you will feel like that a robot could do that stupid work much faster.
Icfu
Last edited by icfu on 2005-02-12, 13:08 UTC, edited 2 times in total.
This account is for sale
Who has to spend his time with complicarted codes with icfus solution? He spend his time to make the complicated (?) code work.nimbus wrote:I wrote my thread for the readers who dont like to spend their much times for complicated codes
Thus you only once have to make a button, copy icfus code and then you will be able to make directories from each textfile without concerning what to add to the lines and which mode to use with what editor. Or even type it line by line.
And icfus command does the same as you propose. But automatically.

sheepdog
"A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete fools."
Douglas Adams
completely foolproof is to underestimate the ingenuity of complete fools."
Douglas Adams