Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Covert files to a text in a spreadsheet?

Status
Not open for further replies.

Westerfield

Mechanical
Jul 8, 2005
7
Does anyone know of a utility that will take a folder and generate a text file of all the file names? I need to put them in a spreadsheet or database to do some comparisons.
 
Replies continue below

Recommended for you

I do it like this:
Open Win Explorer, and go to the folder you want to list the files of
Make sure you have the “Display the full path in the address bar” option selected in Tools / Folder Options / View
Click in the address bar and hit CTRL-C (Copy) to copy the path
Open the Command prompt.
Type in “cd” then paste the path to switch to the folder you want the list of.
Type dir /b /s >Mylist.txt

The file list with all the files and subdirectories will be created in a text file name Mylist.txt in your selected folder root.
 
... I forgot: the way you paste the path after cd (don't forget the space after cd) is click the right mouse button and select Paste from the pop up.
 
You can take that one step further and set it up so you can right click on the folder and write that list into that folder

Create a batch file...say in your rootdir C:\ doesn't really matter where as long as you know where it is
In the file named .bat ..you can use notepad the rename ext.

cd "%1"
dir/b/s >mylist.txt
cd\..
exit

then go to win explorer >tools>folder options>file type
click on the one called folder..not file folder..then advanced>new... then you get the new action box

1st line is what you want it to say when you right click on a folder....something like "write list of folder" :)
in the application used is where you enter the path of the bat file.... c:\writefile.bat

with that dir/b/s... it will write all subs.... so don't do it to far up the tree.. or run the bat by itself at the root level as it will list every file on your drive
you could take the /s off if you only need the files in the first level of the folder

caution.. you have to use regedit to delete the action which really isn't that bad.. do a search for the bat file name in regedit...make sure you type in right the first time and it will be no problem..





 
Thanks SDO and Cadcamguy

I will give this a try!
 
No problem... if you need more info out there are quite a few different output methods with Dir... just type
dir/? in a dos window...oops we don't call it dos anymore
command prompt window :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor