Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copy a list of filenames for spreadsheet editing 1

Status
Not open for further replies.

Johnnybundles

Technical User
Nov 12, 2008
11
0
0
GB
Here's an interesting one! (if you're sad like me)
Not Vista specific, but it's what I'm using.

I have a list of image files in a folder, 150 odd.
I would like to copy the file names and put them into an excel spreadsheet.

Can anyone suggest a way of doing this?
(Other than the PAINFULLY slow way I now do it. highlight the filename hit F2, Ctrl+A, Ctrl+C Ctlr+V into document.)

Any useful suggestions gratefully received.
Johnny.
 
Use a batch file.

Copy the following into notepad, and save it as filename.bat into the directory you want the list from.

Then just double click the icon to have it run.

Code:
@ ECHO OFF
dir /b > list.csv
start list.csv

Provided csv files are associated with Excel, it should work.





----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
WOW!
Thank you - most helpful and a very fast response.

Would you care to explain the commmands? I know they are DOS, but that's about it.

Cheers Johnny.
 
Even faster - download ASAP Utilities add-in. There is a built-in command that wil do exactly what you want. AND put it in a spreadsheet for you.

--
JP
 
I could have sworn I answered your question, o.k well here it is again:

Code:
@ ECHO OFF [green]Disables output to the screen[/green]

dir /b > list.csv [green]dir lists the contents of a given directory, and the /b switch makes it so t just lists names without any additional information.  It then sends it all to a file: list.csv[/green]

start list.csv [green]Opens the created file. As long as CSV files are associated with Excel, which by default they are, it will open excel and show the file. [/green]


Of course you could instead of opening the file with the start command, call excel explicitly and pass the file name to it.




----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Thank you again,
That is most helpful. It's something that has been a problem to me for a while, unfortunately I need to copy lists of file names quite oftern. & I don't know enough about DOS to have created anything like this.
Regards Johnny
 
Glad I could help.

----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Johnny -

Try the add-in ASAP Utilities. I'm not kidding you when I tell you it has to be the most awesome add-in I have ever seen. (No, I'm not the developer or related to the duy who is.)

No DOS neded, no copying and pasting, it's almost idiot-proof. (I have to say almost because there is always someone out there who can prove me wrong.)

--
JP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top