A free Java Files Renamer





JFRenamer allow you to rename files with rules. You can specify a lot of rules to rename the files of a directory. You can also rename sub-directories content.

  • Regex : Apply a regular expression.
  • Case : Change the case.
  • Char change : replace characters.
  • Replace : Replace a string by another.
  • Delete : Delete a part of the name.
  • Insert : Insert a string.
  • If/Else/Endif : For conditional expression.
  • URL : Clean internet characters representation.

  •  Regex

    Apply a regular expression.


    Change the case.

     Char change

    This rule allow to change a caracter by another. Put the caracters to replace in the 'Search' field and the replacement caracters in the 'Replace' field. Yous must have the same number of character in the two fields.


    Delete has no options and uses common settings panel to determine the portion of string to delete.


    This rule allow to insert a string. You can use and the replacement caracters in the 'Replace' field. Uses common settings panel to determine where insert our string. You can use variables in the string.


    It's a special rule that allows you to put a condition on the rules executions it encapsulates. You must begin by a 'If' mode and end by a 'Endif'.


    Between this two rules you can put other statements to execute if the condition match. You can optionaly put an 'Else' with statements to execute if the condition failed.

    Possibilities of 'If' :

    • Name match : The value contain a regular expression apply to the filename.
    • Name contain : The filename must contain the string put in the value.
    • Modify before : The date of the filename is less than the value.
    • Modify after : The date of the filename is greater than the value.
    • Size less than : The size of the filename is less than the value. You can use the letters 'k', 'm' and 'g' for Kilo-octet, Mega-octet and Giga-octet. Example : for all files with a size less than 100Mo use the the value '100m'.
    • Size more than : The size of the filename is greater than the value.
    • Is directory : the element to rename is a directory (and not a file). No value used.
    • Is file : the element to rename is a directory (and not a directory). No value used.
    • Last rule Change : true if the last rule change the filename. No value used.
    • Level : Level of the element in the directory hierarchy. You can use < or > followed by a number in the value. Exemples of value : '1' in the base directory; '>1' in all sub directories; '<3' for the base directory and the first sublevel.


    This rule has no option, it attempts to clean filenames loaded on their internet specials caracters like '%20'.

     Rules common panel

    This panel contains options common to all the rules :

  • Enable : If unchecked the rule will not be used.
  • Case sensitive : If checked the rule is case-sensitive.
  • Use extension : If checked the rule applies to the extension of the file (even if it is a directory).
  • Use file name : If checked the rule applies to the name of the file (without the extension).
  • NB : if both options are checked throughout the filename is used.

  • Start at : indicates a character from which the rule applies, a negative value indicates a number of characters from the end of the name.
  • on length : indicates the number of characters to use a negative value indicates a number of characters to be subtracted from the total length of the chain (-4 means that if, for example, your chain has a length of 11, we use 7 characters).

  •  Variables

    JFRenamer allow the use of variables in insert and replace string. You can also format these variables.

    Variable names are enclosed in less than '<' and more then '>' , it may contain a format that is separated from the variable name by the sign '¦' :

    < name | format >

    Predefined variables :

    n : sort number

    The 'n' variable corresponds to the sequence number in the list of files displayed. The first file is numbered 1, the next 2, etc.

    If you change the order of the list, such as sorting by date rather than by name indexes will be updated.

    'n' allow you to re-number your files. For example <n|i03> will give you a file number (in the sort order you choose) on three digits

    date : last modified date of the file

    'date' gives you the last modified date of the file or directory. This can be useful for adding unveil a portion of the date of the file name.

    Of course it must be used in conjunction with the date format 'd'.

    Par exemple <date|dyyyy-mm-dd> will give you the date of the file with the four-digit year, month and day two-digit and separated by '-'.

    dir : name of the parent directory containing the file

    'dir' is the name of the parent directory containing the file.

    This can be very interesting if for example you have directories of digital photos that you've named, and you want apply this name to each photo.

    level : level in directories

    'level' is the levelof the directory containing the file. it's 1 for the base directory, 2 for a file in a subdirectory of your base directory, and so on.

    You can use it when you rename files with the subdirectories option.

    Regular expressions groups

    In regular expressions you find group delimited by parentheses. These groups are numbered: the first encountered in the regular expression is numbered 1, the second 2...

    You can use the number of a group like a variable. For example, if you have a regular expresion like that : '(\d+)(.*)$', you can use the string captured by the first group with '<1>'. You can also use a format : '<1|i03>'. You can use the second group : this place the second group before the first and format the first like an integer on three digits '<2><1|i03>'

    Formats :

    The format is prefixed by a letter indicating the nature of the format followed a string that represents the format.

    • 'i' : for an integer : May be optionally followed by a number preceded by a zero or a space. This allows you to specify the number of digits of your number.
    • 'd' : pour une date : for a date: You can use the following elements to format your date.
      Letter Date or Time Component Presentation Examples
      G Era designator Text AD
      y Year Year 1996; 96
      M Month in year Month July; Jul; 07
      w Week in year Number 27
      W Week in month Number 2
      D Day in year Number 189
      d Day in month Number 10
      F Day of week in month Number 2
      E Day in week Text Tuesday; Tue
      a Am/pm marker Text PM
      H Hour in day (0-23) Number 0
      k Hour in day (1-24) Number 24
      K Hour in am/pm (0-11) Number 0
      h Hour in am/pm (1-12) Number 12
      m Minute in hour Number 30
      s Second in minute Number 55
      S Millisecond Number 978
      z Time zone General time zone Pacific Standard Time; PST; GMT-08:00
      Z Time zone RFC 822 time zone -0800
      For example dHH_mm give you the hour and minute, each on two characters and separated by an underscore '_'.
    • 's' : for a string. May be followed by a number or two numbers separated by a dot. The first number indicates the minimum number of characters and the second is the maximum number of characters. For example s4.4 ensures that the resulting string will be four characters.