Four digit extension to three digits

A swapping-ground for Regular Expression syntax

Four digit extension to three digits

Postby tgw » Tue Dec 11, 2012 12:15 am

I have a set of files with four digit file extensions:
File.0001
File.0002
File.0003
I need them to have only three digit extensions:
FIle.001
File.002
File.003
I want to ensure that the files are not renumbered because the sequence must be preserved. Is there a way to just remove the first zero from the extensions?
tgw
 
Posts: 1
Joined: Mon Dec 10, 2012 11:38 pm

Re: Four digit extension to three digits

Postby Stefan » Tue Dec 11, 2012 7:15 pm

tgw wrote:I have a set of files with four digit file extensions:
File.0001
File.0002
File.0003
I need them to have only three digit extensions:
FIle.001
File.002
File.003
I want to ensure that the files are not renumbered because the sequence must be preserved. Is there a way to just remove the first zero from the extensions?


Hmmm, maybe try (with copies!)

FROM:
File.0001
File.0002
File.0003

Add extension:
File.0001.TXT
File.0002.TXT
File.0003.TXT
Rename.

Search for '.0' and replace with '.'
File.001.TXT
File.002.TXT
File.003.TXT

Remove extension
File.001
File.002
File.003
Rename.
Stefan
 
Posts: 736
Joined: Fri Mar 11, 2005 7:46 pm
Location: Germany, EU


Return to Regular Expressions