CleanCode Perl Libraries
Multi-Lingual Library Maintainability
available: Perl not available: Java not available: JavaScript not available: Certified
Class
not available: Testable
Class
not available: Standalone
Mode
not available: Diagnostic
Enabled

NAME

grouprename - Rename a group of files and optionally normalize sequence numbers.

SYNOPSIS

usage: renameGroup [-s] [-d <digits>] <old prefix> <new prefix> <suffix>

OPTIONS

        -s          show what would change; do not execute
        -d digits   normalize sequence numbers in names to specified digits
        -h          help
        -H          longer help (manual page)

REQUIRES

Perl5.005, Getopt::Std, Pod::Usage

DESCRIPTION

Renames a group of files in the current directory ending in the specified <suffix>, which may be a string or a regular expression (e.g. "htm" will match xx.htm but "htm.*" will match xx.htm or xx.html). The <old prefix> and <new prefix> are actually the entire basename of the file, not counting a sequence number. That is, if you have a series of files xx1.txt, xx25.txt, xx04.txt then you could change the xx to any other string. At the same time, you can normalize the sequence numbers to the same number of digits with the -d flag so they will sort numerically even though they are strings. Specifying "-d 3" on the above files, for example, would yield yy001.txt, yy025.txt, and yy004.txt.

Note that the current implementation does not work on files without some type of sequence number.

SEE ALSO

If you want a regular-expression based rename utility and are not concerned about sequence numbers, see Larry Wall's simple and elegant file name fixer in the Perl Cookbook.

BUGS

None

AUTHOR

Michael Sorens

VERSION

$Revision: 8 $ $Date: 2006-12-19 21:13:43 -0800 (Tue, 19 Dec 2006) $

SINCE

CleanCode 0.9.08


CleanCode Perl Libraries Copyright © 2001-2013 Michael Sorens - Revised 2013.06.30 Get CleanCode at SourceForge.net. Fast, secure and Free Open Source software downloads