Forum Moderators: phranque

Message Too Old, No Replies

20,000 files in computer to a listing of all file names in .txt file

         

PFOnline

7:49 pm on Apr 13, 2004 (gmt 0)

10+ Year Member



OK, this is kind of a tough question to explain, so please bare with me... :)

I have about 20,000 files all on my computer and they are in a directory structure like this for example...

C:\bands\b\beatles\yesterday.txt
C:\bands\p\pink_floyd\comfortably_numb.txt
C:\bands\l\led_zeppelin\stairway_to_heaven.txt

And I need to take a listing of all the files in the bands folder to 1 single .txt file, that will look similar to the above example.

All the way from A to Z... just a .txt file, listing all the band folders and file names.

End result being a text file with the contents:

C:\bands\a\abba\angeleyes.txt

all the way to:

C:\bands\z\zz_top\waitin-for-the-bus.txt

Any idea how to do this?

PFOnline

7:51 pm on Apr 13, 2004 (gmt 0)

10+ Year Member



Oops, if a mod happens to read this, and gets a chance, could they please fix the topic?

john_k

7:59 pm on Apr 13, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



xcopy C:\bands\*.* C:\TEMP /D /L /R /S /Y >C:\TEMP\list.txt

Dreamquick

8:07 pm on Apr 13, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Try running this from a command prompt / dos prompt, it will list just the absolute filepath (/b), ordered by directory then name (/o:gn), searching sub-directories (/s) for files matching *.txt - and whatever it finds will be stored to myfilelist.txt.

Just remember to start it from the lowest point you want it to search, so if you want it to scan through C:\mybands then start it in that directory - if you want it to search the whole drive then start it in C:\.

dir /b /o:gn /s *.txt > myfilelist.txt

- Tony

PFOnline

8:11 pm on Apr 13, 2004 (gmt 0)

10+ Year Member



Nevermind! oilman sent me a sticky to a program that will do this for you automatically! Thanks oilman!

And thanks john and dream...

Problem solved... :)