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 sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Generate file list with "dir" command, make into spreadsheet

Status
Not open for further replies.

CopySage

Technical User
May 15, 2009
3
US
I have a project, 2,000+ files to label as to file characteristics, like file name, location, type, size, date created, and end up on an Excel spreadsheet where I will add a brief description of the file content. So problem #1 is getting the info right, and in the right format.
I have an idea of how I may generate this, but having a hard time getting the commands just right. I'm trying to use the DOS "dir" command, send it to a file with > filename.ext, tried dir /s [lists subdirectories] /tw [shows Last Written timefield].
Problem #2 is this - if I can get these to show in column format, I believe I can generate the spreadsheet, maybe using Word to table to Excel spreadsheet route.
Any suggestions?
 
DIR always puts the data in fixed column format. If the files are in multiple subdirectories, you will want to use the /s option.

The name of eacj subdirectory will be on a separate header line, and you will have to deal with that.

You can exclude listing the subdirectories as files by using the /a-d option. Note that normally, DIR also lists the current and parent directoris as "." and "..", which will be excluded by this option.

There will be two leader lines, giving the drive letter and volume name. There will also be two trailer lines showing the total number of files and directories, with the total byte count and the free space byte count. You will have to decide whether you want to include this information and how to deal with it.
 
Thanks webrabbit,good new info on excluding directory names from list. Now I'm trying to get other file info to print, the kind of stuff that is optional on the Windows file list, like genre, etc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top