Google Answers Logo
View Question
 
Q: Pasting list of file names in excel ( Answered,   1 Comment )
Question  
Subject: Pasting list of file names in excel
Category: Computers > Software
Asked by: johnr1-ga
List Price: $2.00
Posted: 08 Feb 2006 07:46 PST
Expires: 10 Mar 2006 07:46 PST
Question ID: 443101
I have a long list of files in a folder.  In my case they are all
images.  I want to take all the image/file names and paste them into a
column in excel so there would be one file name per row.  I thought
about using notebook to paste the names but I can't seem to just get
the text of the file names without copying the files themselves.  Any
help would be great.
Thanks,
J
Answer  
Subject: Re: Pasting list of file names in excel
Answered By: palitoy-ga on 08 Feb 2006 09:41 PST
 
Hello johnr1-ga,

Thank-you for your question.

The simplest way to do this is to utilise the command prompt in
Windows and follow a few simple commands.

1) Go to your Start button and choose Run.

2) Type:

cmd.exe

Press enter.  This should open up a new window on your screen (which
is predominantly black).

3) Type:

cd\

The last line in the window should now be saying something like C:/>
(and then a flashing cursor).

4) Type

dir c:\windows /b >list.txt

Where c:\windows is the path to your folder.  Take careful note of the
direction of the slash characters, they should be back-slash for the
path and forward-slash for the /b.

5) If you now go to My Computer and double-click on the C: hard drive
icon you will see a file called list.txt.  This file will contain all
the filenames in the directory you specified in part 4).  You can then
copy and paste the list into Excel.

If you have any questions about this answer please do not hesitate to
ask for clarification and I will do my best to respond swiftly.

Request for Answer Clarification by johnr1-ga on 08 Feb 2006 10:55 PST
good solution though I had trouble doing it on a file deep in my docs.
 It seemed it would only work when the folder was just one word and
placed in the very top level of my C drive.  Other than that it always
said it couldn't find the path I was requesting.
Also, it didn't seem to work when the folder was in a the top level of
an external drive (e:), does it have to be in my C drive?

Clarification of Answer by palitoy-ga on 08 Feb 2006 11:18 PST
What was the folder you were trying to access?  This method should
work on any drive in any folder.  Are you sure you used cmd.exe and
not command.com?  You could try enclosing the drive name in quotation
marks (").

What version of Windows are you on?

Clarification of Answer by palitoy-ga on 08 Feb 2006 11:27 PST
Another solution would be to edit a Windows Script Host file such as this one:
http://www.johntopley.com/kb/wsh/0011.html

You would simply need to alter the path and the file type that is
being searched for.
Comments  
Subject: Re: Pasting list of file names in excel
From: manuka-ga on 28 Feb 2006 01:20 PST
 
If you add double quote marks " " around the folder path it should work.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy