Question Locked

Writing filenames to an excel spreadsheet

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

How do I copy the entire list of filenames from a directory (such as a catalogue of photos with codes for names) and write them to an excel spreadsheet?

(I don't mind if I have to go through another program, but I just want to have the ability to get them into a spreadsheet)

Many thanks in advance :)

OS: Windows XP

5 replies

by dexter.eustis

Click on "Start" then the "Run" command. When the Dos window pops up type "dir {path statement to the directory you want to list} >{text file name.txt}

Example: command to list the c drive to a test file would look like this.

Prompt
C:\Documents and Settings>

Type
C:\Documents and Settings>Dir C:\ >Testfile.txt

The output would be a file named Testfile.txt and would be located in the C:\Documents and Settings directory.
Then just open this file from inside Excel. When asked how this file is formatted, check the boxes for "delimited" and "space".

Hope it helps.

by paul.cook

Using:
dir /b c:\>testfile.csv

will only output the filenames into a comma separated file which can be opened with Excel.

Heck, you can even use:
dir /b c:\>testfile.XLS but you'll get an error while opening the file, but it WILL work.

by robo_dev

JR Directory printer, PrintFolder, etc,

These apps all can output to a text file.

Some people have DOS-phobia.

by heather

Can you walk me through on how to do this? Is this done from the command prompt? Do I create a file name called "testfile.csv"? I have 10,000 .jpg file names that need to go into about 6,000 different cells in Excel, all separated by commas. I still have to cut and paste them into the individual cells but creating a .csv file will help with the process. Is there a program that will add the commas for me after I make the file names into a text format?

This discussion is closed to new replies.