Git Product home page Git Product logo

fix_filenames's Introduction

fix_filenames

http://github.com/goerz/LPBS

Author: Michael Goerz

Recursively rename all the given files and folders so that their names only consist of 'safe' ASCII characters.

Command Line Options

Usage: fix_filenames.py [options] FOLDER

Recursively rename all the given files and folders so that their names only consist of 'safe' ASCII characters.

Options:
  -h, --help            show this help message and exit
  --logfile=LOGFILE     Name of logfile. Default: fix_filenames.log
  --encoding=ENCODING   Encoding of filesystem. Normally, this is detected
                        automatically.
  -n, --dry-run         Dry-run, don't rename any files
  -y                    Do not ask for confirmation before renaming files
  --replacements=REPLACEMENTS
                        Name of file containing replacements. File must
                        contain pairs of lines. Each first line must contain a
                        string to be replaced (with unicode escapes). Each
                        second line must contain a replacement string.
                        Interactively defined replacements will be added to
                        the file.
  --allowed=ALLOWED     String of characters to be added to the default set of
                        allowed characters (unicode-escaped). The default
                        character set consists of the english alphabet,
                        digits, space, and the characters
                        _-[]*(){}",;+^!&#$=@~. For example, --allowed='\n\r'
  --forbidden=FORBIDDEN
                        String of characters to be removed from the default
                        set of allowed characters. For example, to not allowed
                        spaces in filenames, use --forbidden=' '

Recommended Usage

For safety, it is best to call the program with options -n and --replacements to build a list of replacements without renaming anything. Then -- after carefully examining the log file from the first run -- the program should be run again, using the previously generated list of replacements to perform all necessary replacements non-interactively.

You may set the set of allowed and forbidden characters depending on your operating system and other requirements (e.g. no spaces in filenames). See the Filename Wikipedia entry

Note that special care must be taken match the encoding to the one that is used by your file system!

fix_filenames's People

Contributors

goerz avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.