Skip to main content
This question is less to do with sed than with regular expressions (none of the answers include sed; nor could they) Also edited typos and grammar to satisfy G-Man
Source Link

Using sed How to mass rename files with regular expressions

I have a bunch of folders in a directory with files in them. Most of the filenames have region codes (retropie), and the scrubber will not match roms with single letter region codes (u,j,e,etc.). I need to remove all regonregion codes. Region codes are all contained in parentheses "()(...)". Any wayIs there anyway to remove all parenthesisparentheses and the text between them.
EDIT?

For example: For example;
Files

Files are intitled

~/RetroPie/roms/<system>/ 

And I want to rename roms like so:

Super Mario Bros (J).nes Super Random game (J,U,E).nes 

to

Super Mario Bros.nes Super Random game.nes 

Hope That fixes the [on hold] tag thing.

Using sed to mass rename files

I have a bunch of folders in a directory with files in them. Most of the filenames have region codes (retropie), and the scrubber will not match roms with single letter region codes (u,j,e,etc.). I need to remove all regon codes. Region codes are all contained in "()". Any way to remove all parenthesis and the text between them.
EDIT: For example;
Files are in

~/RetroPie/roms/<system>/ 

And I want to rename roms like so:

Super Mario Bros (J).nes Super Random game (J,U,E).nes 

to

Super Mario Bros.nes Super Random game.nes 

Hope That fixes the [on hold] tag thing.

How to mass rename files with regular expressions

I have a bunch of folders in a directory with files in them. Most of the filenames have region codes (retropie), and the scrubber will not match roms with single letter region codes (u,j,e,etc.). I need to remove all region codes. Region codes are all contained in parentheses "(...)". Is there anyway to remove all parentheses and the text between them?

For example:

Files are titled

~/RetroPie/roms/<system>/ 

And I want to rename roms like so:

Super Mario Bros (J).nes Super Random game (J,U,E).nes 

to

Super Mario Bros.nes Super Random game.nes 

Hope That fixes the [on hold] tag thing.

added 166 characters in body
Source Link
pcs3rd
  • 65
  • 1
  • 7

I have a bunch of folders in a directory with files in them. Most of the filenames have region codes (retropie), and the scrubber will not match roms with single letter region codes (u,j,e,etc.). I need to remove all regon codes. Region codes are all contained in "()". Any way to remove all parenthesis and the text between them.
EDIT: For example;
Files are in

~/RetroPie/roms/<system>/ 

And I want to rename roms like so:

Super Mario Bros (J).nes Super Random game (J,U,E).nes 

to

Super Mario Bros.nes Super Random game.nes 

Hope That fixes the [on hold] tag thing.

I have a bunch of folders in a directory with files in them. Most of the filenames have region codes (retropie), and the scrubber will not match roms with single letter region codes (u,j,e,etc.). I need to remove all regon codes. Region codes are all contained in "()". Any way to remove all parenthesis and the text between them.

I have a bunch of folders in a directory with files in them. Most of the filenames have region codes (retropie), and the scrubber will not match roms with single letter region codes (u,j,e,etc.). I need to remove all regon codes. Region codes are all contained in "()". Any way to remove all parenthesis and the text between them.
EDIT: For example;
Files are in

~/RetroPie/roms/<system>/ 

And I want to rename roms like so:

Super Mario Bros (J).nes Super Random game (J,U,E).nes 

to

Super Mario Bros.nes Super Random game.nes 

Hope That fixes the [on hold] tag thing.

edited body
Source Link
pcs3rd
  • 65
  • 1
  • 7

I have a bunch of folders in a directory with files in them. Most of the filenames have region codes (retropie), and the scrubber will not match roms with single letter region codes (u,j,e,etc.). I need to remove all regon codes. Region codes are all contained in "()". anyAny way to remove all parenthesis and the text between them.

I have a bunch of folders in a directory with files in them. Most of the filenames have region codes (retropie), and the scrubber will not match roms with single letter region codes (u,j,e,etc.). I need to remove all regon codes. Region codes are all contained in "()". any way to remove all parenthesis and the text between them.

I have a bunch of folders in a directory with files in them. Most of the filenames have region codes (retropie), and the scrubber will not match roms with single letter region codes (u,j,e,etc.). I need to remove all regon codes. Region codes are all contained in "()". Any way to remove all parenthesis and the text between them.

Post Closed as "Needs details or clarity" by Rui F Ribeiro, Jeff Schaller, Michael Homer, jimmij, Alexander
edited tags
Link
Jeff Schaller
  • 68.8k
  • 35
  • 122
  • 266
Loading
Source Link
pcs3rd
  • 65
  • 1
  • 7
Loading