How can I copy a list of files in a folder to a txt file?

delussional77

Member
Jan 1, 2004
175
0
0
I have a few folders with about 200+ files. I essentially want to get a big list of alphabetical file names that I can print out.

How can I get the file contents of a folder onto a clipboard so i can put them into excel or something and sort by name.
 

RebateMonger

Elite Member
Dec 24, 2005
11,586
0
0
At the Command Prompt:
"DIR >junk.txt"

will redirect the directory listing to a text file named junk.txt
You can sort the file names in Excel, or you can use the /O: (sortorder) parameter on the DIR command to set the order of the listing.

example:
DIR /O:E >junk.txt
will sort the file names by the extension
 

delussional77

Member
Jan 1, 2004
175
0
0
sweet, got that to work

next question, i have put them all in excel and it's added a few characters in front of each title, all being the same.

How can i get excel to remove the the beginning portion of the filename

example (excel cell):
file: AEP_496.jpg

I just want:
AEP_496.jpg

? Thanks for the help RebateMonger!!
 

Fardringle

Diamond Member
Oct 23, 2000
9,200
765
126
Click on the Edit menu and chose Replace.

In the Find what: field type file: . (make sure you include the space after the colon)

Leave the Replace with: field blank.

Click on the Replace All button.

This will remove all instances of "file: " from the spreadsheet, leaving the file names intact.


edit: typo :)
 

RPDP

Junior Member
Oct 23, 2006
11
0
0
try the /b switch with dir command, like:

C:/> dir /b > out.txt

it will only lists the file names nothing else...