Saturday, December 22, 2007

Quickly printing a list of files to a file

I sometimes receive a number of files by e-mail from clients for translation. In the quotation I submit to the client, I append the list of files that I have received (it is important to include dates and sizes of each file). This list ensures that there is no mistake in what you translate and deliver to the client. Some of my clients have a tendency to change the source text after sending the files and forget to send me the revised files. After I deliver the translated files they may point out that some of the text has not been translated. This is where the list of files comes in handy. I ask them to send me the file and compare the date stamp with that of the file in the list I have prepared.

I use the good old DOS command to create this list of files. Here's what you do:

1) Write down the path to the directory on a memo (say c:\trans\clientA\december)

2) Click Start/Run (in Japanese Windows, ファイル名を指定して実行)

3) Type "cmd" (without quotation marks) and hit Enter

4) Type "cd c:\trans\clientA\december" (without quotation marks; note the space between cd and c:. This takes you to the directory where you stored the files)

5) Type "dir > filelist.txt" (without quotation marks)

This gives you the complete list of files in the directory that includes the date , time, and file size. Append this file when you send in your quotation. Here's an excerpted filelist.:

==== Excerpt from filelist.txt ===============

2007/10/19 10:48 97,042 base.swf

2007/10/24 15:13 1,225 base01.rbp

2007/10/19 10:49 24,070 certificate.swf

2007/10/19 12:50 30,330 certificate.swfproject

2007/10/19 12:56 24,111 certificate_translated.swf

2007/10/18 11:44 3,662 Count13flReport.html

2007/10/19 10:50 34,642 glossary.swf

2007/10/19 10:51 163,560 help.swf

8 個のファイル 378,642 バイト

For more options related to the "dir" command, type "dir /?" at the command prompt. "dir /B" gives you just the names of files in the directory.


Anonymous said...

Where you wrote, "In Japanese Word," did you mean Windows?

Gururaj Rao said...

Ahh! I slipped. Thanks so much for pointing it out. This has been corrected.

Gururaj Rao

Anonymous said...

OK, similar problem. I have a browser with 15 or so tabs open of stuff I'm translating. I want to make a list of each of those urls.


elipsett said...

This is certainly useful, but then you end up with the output file in a strange directory. Especially if you are dealing with unwritable sources and multiple subdirectories, such as capturing all the file names on a CD, you want to end up with a file somewhere useful. In that case, it would be better to use
dir [drive]:¥[path] > [drive]:¥[path]¥filelist.txt

If you want all the subdirectories too, then you would use
dir /s > [drive]:¥[path]¥filelist.txt

when using the cd command to move around, you can jump UP by entering
(This is very useful because there are times when it is real difficult to input a Windows directory name...)

And if you have made a mistake and your screen is filled with an endless dump of filenames, you can enter CTRL+C to stop it dead.

Other commands that can be very useful are:
us (switches the console to English)
jp (switches the console to Japanese)
help (displays info on command usage)
help | more (That's a vertical line, usually SHIFT+yen key; it will display the help info in single-screen units so you can actually read the darn stuff before it scrolls offscreen)

Gururaj Rao said...

Thanks for your comment, Ed. You wrote:
"This is certainly useful, but then you end up with the output file in a strange directory."
I prefer to create the directory list file in the directory in which the list of files exist. So if you go to that directory (cd c:\trans\client\december) when in DOS and then type the "dir" command you should end up with the output file in the same directory.

Thanks for your other useful redirection commands too. I wonder whether there are others here reading this blog other than old codgers like you, me and Wolfgang from the "DOS era!"

elipsett said...

If you want your DIR dump in the same directory, that's fine. It can be a little hard to do if you're grabbing the DIR dump from a DVD, tho...

Gururaj Rao said...

Ed, you have a good point. The thought of dumping file lists from CDs and DVDs did not strike me at all. In that case, it would be best to redirect the output path for dumping the file list as you mentioned.