Welcome to DU! The truly grassroots left-of-center political community where regular people, not algorithms, drive the discussions and set the standards. Join the community: Create a free account Support DU (and get rid of ads!): Become a Star Member Latest Breaking News General Discussion The DU Lounge All Forums Issue Forums Culture Forums Alliance Forums Region Forums Support Forums Help & Search

Turbineguy

(37,343 posts)
Tue Jan 7, 2020, 08:24 PM Jan 2020

Batch file rename

I want to rename a large number of files. The file names look like this

10-L-1 Stuff.docx

I want to change the "L" into an "8"

And leave everything else as is.

Anybody know a fairly simple to understand method for that?

I've already looked for the Windows 10 method but that changed everything.

6 replies = new reply since forum marked as read
Highlight: NoneDon't highlight anything 5 newestHighlight 5 most recent replies
Batch file rename (Original Post) Turbineguy Jan 2020 OP
Here's a windows link Midnightwalk Jan 2020 #1
There are several Windows file explorers that support multi-rename/batch file rename. Eugene Jan 2020 #2
I've used this in the past canetoad Jan 2020 #3
Thanks! Turbineguy Jan 2020 #4
Here you go discntnt_irny_srcsm Jan 2020 #5
I can't get the syntax to work. Turbineguy Jan 2020 #6

Midnightwalk

(3,131 posts)
1. Here's a windows link
Tue Jan 7, 2020, 08:39 PM
Jan 2020

I’d make a copy of the files into a new directory first and use the command line version myself but I don’t use windows for anything much any more so I can’t vouch for this.

[link:https://www.google.com/amp/s/www.windowscentral.com/how-rename-multiple-files-bulk-windows-10%3famp|]

For unix/mac it would be a few line script depending on how simple the pattern was. I’d still work on a copy of the files and would probably google linux rename multiple files if I didn’t have time to mess with it.

Eugene

(61,900 posts)
2. There are several Windows file explorers that support multi-rename/batch file rename.
Tue Jan 7, 2020, 08:41 PM
Jan 2020

I use FreeCommander XE, which does it as select files and do a text search-and-replace.

Double Commander (open source) and Q-Dir (freeware) also offer this, but I have not tried them myself.

discntnt_irny_srcsm

(18,479 posts)
5. Here you go
Wed Jan 8, 2020, 08:07 AM
Jan 2020

Type this at the command line:
ren 10-L-*.txt 10-8-*.txt


Here is the rename help:
Renames a file or files.

RENAME [drive:][path]filename1 filename2.
REN [drive:][path]filename1 filename2.

Note that you cannot specify a new drive or path for your destination file.

The syntax of the windows help above uses [] to enclose optional terms.

Turbineguy

(37,343 posts)
6. I can't get the syntax to work.
Thu Jan 9, 2020, 01:52 PM
Jan 2020

Drive F

1st Folder PMI

Sub Folder 61

2nd Sub folder QMEDEX

3rd Sub Folder QMEDANS

File name 01-J-3 Quiz A.docx

Desired name 01-10-3 Quiz a.docx

I need to know the exact syntax

The other files that I want to rename have 01, 02, 04 etc in the first number and 3, 4, 5 in the 3rd number

I only want to change the "J" into a "10"

Thanks

Latest Discussions»Help & Search»Computer Help and Support»Batch file rename