How do I import a list of filenames from Explorer to Excel?

L

Lars

I often need to copy a list of filenames presented in Explorer into Excel
(or any other suitable editor). Is there any smart trick in Win XP to
automate this process? Today I use copy and paste on every single filename,
which is not a very intelligent way of doing it.
 
J

Jay

I often need to copy a list of filenames presented in Explorer into
Excel (or any other suitable editor). Is there any smart trick in Win
XP to automate this process? Today I use copy and paste on every
single filename, which is not a very intelligent way of doing it.

The way I do this in Win98 is to use a batch file like this:

@dir %1 /-p /o:gen > "%temp%\dir.txt"
notepad "%temp%\dir.txt"
del "%temp%\dir.txt"
exit

Then I added a menu command to folders, pointing it to the batch file.

With this setup, I can right-click on a folder, invoke the menu command,
and get a text file with the list of filenames.

After cleaning it up a bit, the text file can imported by Excel.
 
G

Gord Dibben

Lars

Several methods to accomplish this.......I like Tushar's best.

To add a "Print Directory" feature to Explorer, go to
this KB Article.

http://support.microsoft.com/default.aspx?scid=KB;EN-US;q272623&

Or you can download Printfolder 1.2 from.....

http://no-nonsense-software.com/freeware/

I use PF 1.2 and find it to be more than adequate with custom features.

OR Go to DOS(Command) prompt and directory.
Type DIR >MYFILES.TXT

All the above create a *.TXT file which can be opened in Excel.

One more method if you want to by-pass the *.TXT file and pull directly to
Excel is to use Tushar Mehta's Excel Add-in. This allows filtering and
sorting once you have the data in Excel.

http://www.tushar-mehta.com/ scroll down to Add-ins>Directory Listing.

Download the ZIP file and un-zip to your Office\Library folder.

Gord Dibben Excel MVP
 
L

Lars

Thank you!
Lars

Jay said:
The way I do this in Win98 is to use a batch file like this:

@dir %1 /-p /o:gen > "%temp%\dir.txt"
notepad "%temp%\dir.txt"
del "%temp%\dir.txt"
exit

Then I added a menu command to folders, pointing it to the batch file.

With this setup, I can right-click on a folder, invoke the menu command,
and get a text file with the list of filenames.

After cleaning it up a bit, the text file can imported by Excel.
 
Top