Socket
Book a DemoInstallSign in
Socket

filter_rename

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

filter_rename

bundlerRubygems
Version
1.1.0
Version published
Maintainers
1
Created
Source

FilterRename

FilterRename is a CLI tool created to rename a bunch of files at once applying a cascade of self-explainatory options called filters, in order to substitute all the other shell commands (like sed, awk, trim, ... ) and personal shell script to achieve that goal safely and in comfortable manner.

To simplify the whole process through a command line, the full filename is logically organized in targets like:

<path>/<folder>/<name><ext>

Considering the file /home/fabio/Documents/Ruby/filter_rename/Gemfile.lock we have:

  • path: /home/fabio/Documents/Ruby
  • folder: filter_rename
  • name: Gemfile
  • ext: .lock

The chain of filters will be applied to the current target which can be selected using the --select option, the default target is name.

Installation

Install it yourself as:

$ gem install filter_rename

Usage

The main concept about FilterRename is the target manipulation with a chain of filters executed one by one as they appear in the argument's list.

There are three main operations:

  • preview: show the results without make any change (default);
  • dry-run: executes a simulation warning when a conflict is raised;
  • apply: confirm the changes and rename the files unless the destination file exists.

Having the files:

home
  fabio
    Documents
      Photos
        Vacations
          image_portofino_1.jpg
          image_portofino_2.jpg
          image_portofino_3.jpg
          ...

to replace underscores with spaces and capitalize each word let's execute:

filter_rename /home/fabio/Documents/Photos/Vacations/*.jpg --spacify '_' --capitalize --apply

and the result will be:

home
  fabio
    Documents
      Photos
        Vacations
          Image Portofino 1.jpg
          Image Portofino 2.jpg
          Image Portofino 3.jpg
          ...

Get help

Where to start

$ filter_rename --help

More help

  • The wiki page: https://github.com/fabiomux/filter_rename/wiki

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/fabio_mux/filter_rename. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

FAQs

Package last updated on 23 Sep 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.