×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Covert files to a text in a spreadsheet?

Covert files to a text in a spreadsheet?

Covert files to a text in a spreadsheet?

(OP)
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.

RE: Covert files to a text in a spreadsheet?

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.

RE: Covert files to a text in a spreadsheet?

... 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.

RE: Covert files to a text in a spreadsheet?

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..





RE: Covert files to a text in a spreadsheet?

(OP)
Thanks SDO and Cadcamguy

I will give this a try!

RE: Covert files to a text in a spreadsheet?

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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources