Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rename file pattern windows batch

I have some files looking like following:

ABCD0123_R001_01234567_01234567_01234567-012345.csv

If a run ren *_*_*_*_* *_.* I get:

ABCD0123_R001_01234567_01234567_.csv

But I actually want to get:

ABCD0123_R001_01234567_01234567.csv

There is no documentation if I run ren /? so I would need some help.

like image 524
Mihai238 Avatar asked Feb 27 '14 09:02

Mihai238


People also ask

How do I rename multiple files with sequential numbers in Windows 11?

Use the File Explorer to navigate to the folder where your files are. Select all the files you want to rename, then right-click them and choose See more options in the context menu. Then, choose PowerRename in the second context menu. You'll now see the PowerRename interface with all your selected files.

How do I batch rename file extensions in Windows?

How to batch rename extensions. Navigate to the folder containing the files you want. Once there, launch command prompt from the folder menu by holding down shift and right clicking on an empty space. Once in command prompt, you can now use the “ren” (for rename) command to rename for example, .


1 Answers

If the fields are fixed then try this on some sample files.

ren *.csv ????????_????_????????_????????.*
like image 164
foxidrive Avatar answered Oct 04 '22 22:10

foxidrive