#1
|
|||
|
|||
REGEX for renaming?
Hi. I apologize for not being more knowledgeable about REGEX, but I have been tryng to create a regex for renaming files after they have been grabbed. I want the regex to apply to a filename that contains any value ('.*') and replaces it with a specific filename format. The specific filename format should be something like four sequential digits followed by the filetype (ex. 0001.mp4, 0002.mp4, 0003.mp4, etc.). The 'Search for' value of .* is working, but I have not been able to figure out how to format the 'Replace by' value.
I appreciate any assistance that can be offered! |
#2
|
||||
|
||||
@timba1210:
When you do it via Rightclick->Properties->Rename (F2) then for example this would do it Code:
search for: ^(.*)\.([a-z0-9]+)$ replace by: <jd:indexof>.$2 for example: Code:
match always then filename - <jd:indexof>.<jd:orgfiletype>
__________________
JD-Dev & Server-Admin |
#3
|
|||
|
|||
RE: REGEX for renaming?
:w00t:
That worked like a charm! Thank you so much!!! |
#4
|
||||
|
||||
@timba1210: Thanks for the feedback and you're welcome!
__________________
JD-Dev & Server-Admin |
#5
|
|||
|
|||
Quote:
By way of explaining what I am trying to accomplish, and the reason I wanted to know how to do this for a rename task rather than Packagizer, is that sometimes (without having a common source or other common characteristic), I will find links where the name of the file to be downloaded does not fit my needs in terms of the filename length or format. In those cases, I wanted to know how to use the rename function to replace the original filename with one of my choosing. |
#6
|
||||
|
||||
@timba1210: Thanks for the explanation. In case you need further help on this, just ask
__________________
JD-Dev & Server-Admin |
Thread Tools | |
Display Modes | |
|
|