NAME

numbfile - rename arbitrary files to a number based list

SYNOPSIS

numbfile [-rcvh] [-n num ] [[-p pre ] [-z dig ] [-s suf ] | [-e expr ]] files...

DESCRIPTION

numbfile takes a list of arbitrarily or otherwise undesirably named files and renames them so that they have a characteristic pattern based on sequential numbers. The exact format of the resulting naming style can be specified as parameters describing explicit components or alternatively, by an example expression.

OPTIONS

-c
Check action of command. This causes no renaming to take place; instead, an output of what the command would have done is sent to standard output.
-e expr
Specifies the entire format of the resulting filenames. The format for expr is:
[prefix]^[^...][suffix]
Each caret (circumflex) is used as a literal place holder to represent the desired number of digits. If not enough number places are specified, the filenames simply will not have leading zero padding beyond the number given. The minimum argument for this option is a single " ^ " which produces filenames that are nothing more than unpadded sequential numbers. A correctly formatted -e option will nullify conflicting options. The "^" character can be interpreted as a special character by the shell. This is desirable since very few files contain it, yet it usually is unnoticed by the shell. To use this character literally in the file names, don't use the -e option. Instead, use -p, -s, and -z.
-h
Invokes a usage summary. This option cancels any other.
-n number
Resets the initial number to use in the renamed sequence. The default is 1.
-p prefix
Specifies the part of the resultant filename that preceeds the sequential numeric portion. The default value is a null string.
-r
Reverses the counting. This flag causes numbering to start at the number specified by the -n option and decrement backwards from it.
-s suffix
Specifies the part of the resultant filename that follows the sequential numeric portion. The default value is a null string.
-v Verbose. Displays the actual renaming commands.
-z digits
This option allows for zero padding. The argument digits is a number that represents the minimum number of digits to use when formatting the numbers. The default is 1 which never adds leading zeros.

EXAMPLES

To reorganize a bunch of badly named .gif files into a neater group:
$ numbfile -p pound -s .gif *.gif
Creates:
pound1.gif, pound2.gif, pound3.gif...
Often when dealing with a large collection of arbitrarily named files, naming them in reverse order is helpful so that the last used number is readily apparent in a file operation dialog box.
$ numbfile -r -phash -s.dwg -n100 -z3 *
Creates:
hash098.dwg, hash099.dwg, hash100.dwg...
To specify the output filename using an example expression:
$ numbfile -re tictac^^^^^.toe -n2000 *
Creates:
tictac01998.toe, tictac01999.toe, tictac02000.toe...
Or if you don't want leading zeros or a suffix:
$ numbfile -e octothorpe^ -n9 *
Creates:
octothorpe10, octothorpe11, octothorpe9...

AUTHOR

This marginally useful program was written by:
Chris X Edwards <chrisxed@usa.net>

LWM ~ 1999.09.29