Printing your file lists

I guess everyone apart from me, and the user who asked me through the SDL ideas site, knows this already.  But if you have created a Project which has got lots of files in it, maybe lots of folders too and you want a print out of the files in a list so you can either mark the list with a pen as you go along, or use it to provide feedback to your client, then how do you do this?
Actually it’s pretty simple and doesn’t require the purchase of any applications at all.  All you need to do is run a simple command through your command prompt.  Here’s how… first find the folder where all your files are.  The easy way to do this is to right-click in the projects view like this:
Open Project Folder
Then copy the path to the folder from Windows Explorer into your clipboard using ctrl+c (sure I don’t need to tell you this!).  Then open the folder containing the target files if you want a list of sdlxliff files, or the folder with the source files if you want the original source files as well, or instead.  Obviously if you have created the project yourself you can just use the folder containing the original source files… but if it came from a Studio package then do it like this.
Now run a command prompt by typing cmd into the “search programs and files” box here:

This will bring up the command line tool where you can type the letters cd (means change directory) and add a space, then right-click again and select paste to place the path you copied earlier (or type it in manually if you really want to) and press the return/enter key:

Now you should have have something like this:

All you do now is type the command to print the list of files in this location to a text file.  There are a number of ways to do this:

dir > filelist.txt

This will give you a text file in the same folder as your files called filelist.txt that contains lots of information about the folder, filenames, sizes created dates etc.  Maybe more than you wanted:

But you have a number of different switches you can use with this command to change what is contained in the file, so adding /b for example:

dir /b > filelist.txt

This will print only the filenames themselves like this which might be more useful when you want to take these names and copy them into another application for example:

If you have a folder structure here you could also include all the files inside the folders that are inside the folder your Project is in… this starts to sound like an episode of “Soap” 😉

dir /s /b > filelist.txt

The most amazing thing is happening now… I’m getting an overwhelming desire to have DOS based applications back… at least for the performance.  It’s been years since I could run any command on a computer and have the results back this fast!  There are more options that I’ve shown here, and you can find many in wikipedia here : if you’re feeling adventurous.
But to end with I wanted to just provide a neat solution to this that you can edit to your hearts content. You can create a small bat file, which is just a file that you can double click and it will run the commands inside it.  So you can place this bat file into the folder you wish to be listed in this way and have the filelist.txt created just by double clicking the file.  So open up a text editor, notepad/editpad… whatever and copy and paste the following into it (or whatever command you wanted to use);

dir /b > filelist.txt

Now save the file as filelist.bat  All you do from now on is copy this file into the same folder as your files and double click it in windows.  Have fun!

0 thoughts on “Printing your file lists

    1. Yes… but maybe not very important to replace other development? You could take the analysis report, save as excel and then copy the file names in the list. In fact the wordcount report looks pretty good for this as you get the files in a simple list in one column and then the counts next to them. Maybe a very useful report to share… wish I’d thought of that before!

Leave a Reply