11/03/2013

How to Copy a List of Files from a Windows Folder Into an Excel List

Maintaining an Excel spreadsheet of computer files can help you keep track of important business documents or images. Unfortunately, Microsoft Excel doesn't include a one-step method for importing a file list from Windows Explorer, but Windows 7 offers an easy workaround. Using the Command Prompt, you can tell Windows to output a text document containing a directory list. This text document can then be imported into Excel and modified just like any other spreadsheet.
Link back to original post...

Step 1

Press "Win-E" to open Windows Explorer and locate the folder for which you need a file list.

Step 2

Hold the "Shift" key, right-click the folder and select "Open Command Window Here." This only works with folders, not libraries. Libraries point to a specific folder, so select the folder located under the library icon. If the library points to a drive, right-click the drive letter from the folder tree.

Step 3

Type "dir /b > dirlist.txt" without quotes and press "Enter." This creates a list containing file names only. To include file sizes and dates, type "dir > dirlist.txt" instead. To also include files in sub-directories, type "dir /b /s > dirlist.txt" to create a list of files with the full directory structure name, such as "C:\folder\subdirectory\file.txt."

Step 4

Open Microsoft Excel and press "Ctrl-O" to bring up the Open dialog window.

Step 5

Navigate into the folder containing the files [note: this is the folder you right clicked on]. Click the file type drop-down menu and select "Text Files (*.prn,*.txt,*.cvs)." Double-click "dirlist.txt" to open it.

Step 6

Click "Finish" in the Text Import Wizard window to use the default options and import the directory list into Excel.

The dirlist.txt file created by his method could also be opened into Word or any text editor.

No comments: