topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • November 14, 2018, 06:47 PM
  • Proudly celebrating 13 years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: remv: Rename files (and directories) with regular expressions  (Read 1282 times)

Tuxman

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 2,081
    • View Profile
    • Donate to Member
The fan of old-school tools strikes again.  8)
(NANY 2019, anyone?)

Do you know what's missing in both POSIX and Windows? Right: A sane way to rename files/directories with a regular expression.
The usual approach on POSIX systems is:

ls * | sed -E 's/(.*)text(.*)to(.*)remove(.*)/mv & "$1$2$3$4"/' | sh

That is horrendously ugly and does not port well to Windows. Here is my slightly less horrendously ugly attempt to fix that:
https://bitbucket.org/tux_/remv

Enjoy.
« Last Edit: January 14, 2018, 03:08 PM by Tuxman »