Reply to topic

Krename Find & Replace expressions

fozziebear
Registered Member
Posts
4
Karma
0

Krename Find & Replace expressions

Mon Jun 29, 2020 11:22 am
I have several hundreds podcasts which I want to transfer to an mp3 player but the format and title of the file name is too long/complicated. Here is an example of such a file:-
The_Grenfell_Tower_Inquiry_Podcast_-_27_Firefighter_OBeirne_and_Senior_Fire_Safety_Officer_Egan_p06csh8y_podcast.mp3

I need to remove the underscores and title so that it sorts numerically and also the word podcast and the PID e.g.

27 Firefighter OBeirne and Senior Fire Safety Officer Egan.mp3

I have used the Find and Replace option of Krename but don't know what to use in the Replace With field other than a space (ie using the spacebar) but that puts unwanted spaces in the file name and occasionally wont work for strings of characters.
How do you remove characters or text and replace them with nothing?

Secondly each file has its own PID identifier that varies but is in the format p06csh8y. Is there a way of stripping these out when the characters are variable bt fit a standard format? More on the BBC Program Identifier below. https://en.wikipedia.org/wiki/BBC_Programme_Identifier#:~:text=A%20BBC%20Programme%20Identifier%20(PID,iPlayer%20viewers%2C%20and%20internal%20databases.

I am aware this issue is not limited to Krename but is a general programming/File Management routine but don't know where to ask questions as Krename doesn't appear to be developed or supported any more. If there is a specific source of information perhaps someone would be kind enough to point me in the right direction.
User avatar Mamarok
Manager
Posts
5032
Karma
13
OS
Why not use Kid3 for this? It will do exactly what you want and you can also get the proper ID3 tags for your mp3 format.


Currently running Kubuntu 20.10 beta, Plasma 5.19.5, Frameworks 5.74.0, Qt 5.14.2, kernel 5.8.0-25
FWIW: it is always useful to state the exact Plasma version and distribution when asking questions in this forum, makes it easier for us to help ...
fozziebear
Registered Member
Posts
4
Karma
0
Mamarok wrote:Why not use Kid3 for this? It will do exactly what you want and you can also get the proper ID3 tags for your mp3 format.

Thank you Mamarok but these are podcast files in m4a format which i'll convert to mp3 to be compatible with my mobile player. The software you have directed me to is specifically for mp3 music files and wont work with my podcast files as they dont have ID3 Tags.
I have been using Krename sucessfully for months to rename movie and other files I have downloaded but I am stuck on removing spaces and unwanted characters such as the 8 character PID. I am sure there must be a way of doing this but I am not a programmer and don't know the syntax.
Krename seems to use "Tokens" for advanced file name edits including " "\ which is supposed to remove trailing and leading spaces but I only want to remove a space before the extension.I am not sure how to even load tokens in the software.
I really need to hear from someonewho uses Krename regularly with complex file names.
Many thanks
Fozzie
visone
Registered Member
Posts
32
Karma
0
OS
Hi!
find --> any valor you want to change
replace with --> if you want a space, just press space or leave it blank por nothing
fozziebear
Registered Member
Posts
4
Karma
0
visone wrote:Hi!
find --> any valor you want to change
replace with --> if you want a space, just press space or leave it blank por nothing


Thanks Visone. I have tried this and if I put nothing in the Replace field the file remains unchanged. Also I am trying to remove spaces too.

Fozzie
visone
Registered Member
Posts
32
Karma
0
OS
Hi!
Im usually do this to erase de spaces find --> press space replace with --> .
That works for me
If you want to reduce the name, in advance filename/ template use something like this [1-15] to choose from the first to 15's characters. You can start to count from whatever you want [15-25]
User avatar pappl
Registered Member
Posts
21
Karma
0
fozziebear wrote:I have several hundreds podcasts which I want to transfer to an mp3 player but the format and title of the file name is too long/complicated. Here is an example of such a file:-
The_Grenfell_Tower_Inquiry_Podcast_-_27_Firefighter_OBeirne_and_Senior_Fire_Safety_Officer_Egan_p06csh8y_podcast.mp3

I need to remove the underscores and title so that it sorts numerically and also the word podcast and the PID e.g.

27 Firefighter OBeirne and Senior Fire Safety Officer Egan.mp3

......


At first Krename is a great tool. I renamed thousands of photos, and it works perfectly well. Hope there will be further development, because there are no better GUI renaming tools for linux systems.
I hope Search & Replace function will be visually optimized in the future to make it easier to use.

How to rename:
1. Drag and drop all your files you want to rename the same way in the first column.
Image

2. Activate the checkbox in the bottom to overwrite files
Image

3. Skip this column if you don't need data from EXIF-files or other complicated renaming tools
Image

4. Click Search and Replace button.
Image

Click Add Button. In Search field paste the part you want to remove. Leave Replace field empty if you want to remove the charactes.
If you want to replace it with other characters then type in the new text.
Activate all checkboxes "Regular expression".

==========================================
In your case 3 steps necessary (3x add):
Search: The_Grenfell_Tower_Inquiry_Podcast_-_
Replace: leave empty

Search: _p06csh8y_podcast
Replace: leave empty

Search: _
Replace: hit spacebar once
=========================================

Look at preview, hit Rename button. Done.

Only if it does not work, then try to add this char (^) in search filed at the beginning:
Code: Select all
^The_Grenfell_Tower_Inquiry_Podcast_-_





pappl
fozziebear
Registered Member
Posts
4
Karma
0
Thank you so much for your detailed reply Pappl.
I have been meaning to come back to this forum and post my results following Visone's last post.
I think I have discovered why Find and Replace has not been working for me in some cases. I have found that in the Find box I have to put a space before the character or nothing happens. Also when I leave the Replace box empty I sometimes find I end up with multiple spaces in the file name. This has to be corrected by adding another expression with three spaces in the Find box and nothing in the replace field. This could be because I am creating too many individual expressions in Find and Replace to remove different things?

I also don't really understand the difference between the two Functions (trimmed) and (trimmed;.*.) to remove white spaces in a file name and which I should use.
The hardest part which is beyond me is removing the PID number from any media downloaded from iPlayer using get_iplayer. This is the unique programme identity number and varies for every file. In your suggestion _p06csh8y_podcast this would only replace the one entry leaving all other PIDs behind. I am sure a programmer would be able to write an expression to identify varying PIDs which nevertheless follow a standard pattern e.g. for the previous example p06csh8y LNNLLLNL where L- letter and N=number in a string of characters. I am not a programmer and would not know where to start.
Many thanks
Fozzie

 
Reply to topic

Bookmarks



Who is online

Registered users: Baidu [Spider], beerislife, Bing [Bot], Google [Bot], knewbie, Majestic-12 [Bot], nalvarez, schellong, Section_8, Sogou [Bot], uriel, Yahoo [Bot]