Thursday, February 23, 2006

FilenameFormat - generate time-stamped filenames

FilenameFormat.exe is a small utility to format filenames based on the current date and time. It's useful for batch scripting, for example, creating folders or files on a regular basis with a time- or date-stamp.

It uses C#-style "curly brace" formatting. The help outpur explains all:

> FilenameFormat.exe

FilenameFormat - formats filenames with current date/time info.
Copyright (c) 2006 DevDoctor.com

Usage: FilenameFormat <filename_pattern> <datetime_pattern> [<copy_target>]

       where:
       <filename_pattern> is the pattern of the target filename
       <datetime_pattern> is the pattern of the date
       <copy_target> (optional) copy this file to new file with preceeding pattern

Both parameters use C#-style string formatters.

Examples:
       'FilenameFormat datafile_{0}.dat yyyy-MM-dd'
               -->     datafile_2008-02-04.dat
       'FilenameFormat day_{0}.dat dd C:\temp\day.dat'
               -->     day_04.dat; copy 'C:\temp\day.dat' to 'C:\temp\day_04.dat'

You are free to use this utility as you wish.

0 Comments:

Post a Comment

<< Home