JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #1  
Old 09.05.2024, 17:17
timba1210 timba1210 is offline
Super Loader
 
Join Date: Jul 2012
Posts: 29
Default 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!
Reply With Quote
  #2  
Old 10.05.2024, 14:03
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 80,970
Default

@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
Or you can use Packagizer for it, see https://support.jdownloader.org/de/k...the-packagizer
for example:
Code:
match always
then
filename - <jd:indexof>.<jd:orgfiletype>
Maybe you can explain what you're trying to achieve and then we can maybe provide better help/solutions
__________________
JD-Dev & Server-Admin
Reply With Quote
  #3  
Old 10.05.2024, 15:58
timba1210 timba1210 is offline
Super Loader
 
Join Date: Jul 2012
Posts: 29
Default RE: REGEX for renaming?

:w00t:

That worked like a charm!

Thank you so much!!!
Reply With Quote
  #4  
Old 10.05.2024, 16:03
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 80,970
Default

@timba1210: Thanks for the feedback and you're welcome!
__________________
JD-Dev & Server-Admin
Reply With Quote
  #5  
Old 10.05.2024, 16:04
timba1210 timba1210 is offline
Super Loader
 
Join Date: Jul 2012
Posts: 29
Default

Quote:
Originally Posted by Jiaz View Post
@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
Or you can use Packagizer for it, see **External links are only visible to Support Staff**...
for example:
Code:
match always
then
filename - <jd:indexof>.<jd:orgfiletype>
Maybe you can explain what you're trying to achieve and then we can maybe provide better help/solutions

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.
Reply With Quote
  #6  
Old 10.05.2024, 17:18
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 80,970
Default

@timba1210: Thanks for the explanation. In case you need further help on this, just ask
__________________
JD-Dev & Server-Admin
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT +2. The time now is 01:26.
Provided By AppWork GmbH | Privacy | Imprint
Parts of the Design are used from Kirsch designed by Andrew & Austin
Powered by vBulletin® Version 3.8.10 Beta 1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.