Skip to main content

Recursively remove invalid characters from path names.

Project description

RECURSIVELY REMOVE INVALID CHARS IN PATHS

A simple script to find and remove invalid characters in file and directory names. Inspired by the need to workaround limitations of Egnyte's unsupported character types.

The chars are currently hardcoded into the script, but like the list of servers to run on, this should really be added to a config/lst file.

The aforementioned list should reside in $HOME/.ELC.lst. The format is one line per server and lines beginning with # will be ignored.

There is a really convoluted bash version and a nice simple Python version and a W.I.P Powershell version...

run.sh is a bash wrapper script for mounting a list of servers to run the python script on.

INSTALLATION

pip install rmchars

CLI USAGE

usage: rmchars [-h] (-i | -a | -t | -q | -f) [path]

Remove invalid characters from a given path.

positional arguments:
  path               a valid path

optional arguments:
  -h, --help         show this help message and exit
  -i, --interactive  prompt before renaming each path
  -a, --automate     rename each path without prompting
  -t, --dry_run      preform a dry run to see what would be renamed
  -q, --quiet        run silently
  -f, --find         print a list of invalid paths

TODO

  • [x] Add support for unicode and control characters
  • [ ] Add char list to config file
  • [ ] Finish Powershell version

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for rmchars, version 0.0.5
Filename, size File type Python version Upload date Hashes
Filename, size rmchars-0.0.5-py3-none-any.whl (6.5 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size rmchars-0.0.5.tar.gz (4.3 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page