#1 : 18/02-25 10:14 Christian O.
Posts: 6
|
Hi everyone,
I'm a complete beginner when it comes to Advanced Renamer and I really need your help. I have loads of .rar files on my computer and would like to rename them according to my scheme but I don't know what settings I need to set to get the result. I'm tired of doing everything by hand because it's been taking up so much time for days. But let's get to my problem: These files need to be renamed differently from Simaddons – CYQU Grande Prairie Airport v1.0.1 MSFS 2024 Simaddons – CYXS Prince George Airport v9.5.3 MSFS 2020 SimNord – EKBI Billund Airport v1.7.0 MSFS 2020 FSDG – FVFA Victoria Falls Airport v1.1.0 MSFS 2020/2024 MK-STUDIOS – EIDW Dublin Airport v2.3.0 MSFS 2020/2024 to CYQU - Grande Prairie Airport (Simaddons) v1.0.1 (MSFS 2024) CYXS - Prince George Airport(Simaddons) v9.5.3 (MSFS 2020) EKBI - Billund Airport (SimNord) v1.7.0 (MSFS 2020) FVFA - Victoria Falls Airport (FSDG) v1.1.0 (MSFS 2020-2024) EIDW - Dublin Airport (MK-STUDIOS) v2.3.0 (MSFS 2020-2024) I just can't get it to work because the different files are different lengths. can you maybe help me and tell me what I have to set. thanks in advance Chris |
#2 : 18/02-25 13:11 Miguel
Posts: 175
|
Reply to #1:
Hi Christian. You need to use Regular expression for this. Use a Replace method: Replace: (\w.+)\s*–\s*(\w+)\s+([^v]+?)\s+v(\d+\.\d+\.\d+)\s+MSFS\s+([\d-]+) Replace with: $2 - $3 ($1) v$4 (MSFS $5) Case sensitive : Yes Regular expression: Yes If all your files have the same structure I think that this will work. https://drive.google.com/file/d/1SCL1lA1WVTL_9Jj 2KGB3vg8dZCLeviEq/view?usp=drive_link I hope everything goes well Miguel |
#3 : 18/02-25 13:34 Delta Foxtrot
Posts: 431
|
Reply to #1:
Hi Christian, Miguel. You beat me to the draw Miguel, and I didn't read carefully enough the first time anyway. :) That said, here's another way to do it: Hi Christian, You can do this with one Replace method, using regular expressions. First, go to "Settings / Renaming / Word separators:" and make sure that you don't have a dash "-" in that field (there's a dash in one of the first words, we don't want ARen to split that word into two). Click OK and add a Replace: method to the method list. Copy and paste the following responses into the two text entry fields: Replace: ^(<word:1>) – (<word:2>) (.+) (v[\d\.]+) (.*)$ Replace with: $2 - $3 ($1) $4 ($5) (Don't copy the space after the : colons) Then set these values for the other fields: Occurrence: All Case sensitivite: Unchecked Use regular expressions: CHECKED Apply to: Name Load your files and, if they all conform to the pattern you've described, you should get what you want. Check in the "New Filename" column in the files list to make sure, and give it a go. And remember, if something does go wrong you can always undo the batch. By the way, the "before" files have ndashes after the first word. If all files have that then the formula above will work, but if there are regular dashes mixed in at that location they won't get converted. If you find that's the case replace the original "Replace with:" text with this: ^(<word:1>) [–-] (<word:2>) (.+) (v[\d\.]+) (.*)$ Good luck, and fly safe... Best, DF |
#4 : 18/02-25 14:51 Christian O.
Posts: 6
|
wow guys,
that's really nice of you.. unfortunately I can only test it this evening, thank you very much in advance |
#5 : 19/02-25 03:40 Christian O.
Posts: 6
|
hey guys,
first of all, thank you very much to both of you. I have just tested both versions. Miguel's version produced the desired result. Thumbs up ^^ With one small thing that still needs to be changed. The first bracket ( ) in this script has a space after the word. Here is the example: EKBI - Billund Airport (SimNord ) v1.7.0 (MSFS 2020) but it should look like this EKBI - Billund Airport (SimNord) v1.7.0 (MSFS 2020) I have adapted the script, which also produces the result, but I wanted to ask if that is correct and if I won't have any problems with it later (\w.+)\s–\s*(\w+)\s+([^v]+?)\s+v(\d+\.\d+\.\d+)\s+MSFS\s+([\d-]+) I simply deleted the * after the s at the point (\w.+)\s*– can I leave it like that ?? ______________________________________________________________________________________________ Delta Foxtrot Thank you very much for your help, but I think I'm doing something wrong here, because your script version doesn't work for me and doesn't even show me a result I did everything as you described, including the settings "Settings / Renaming / Word separators:" Unfortunately I have no idea why it doesn't work. thank you, thank you, thank you, to both of you ^^ |
#6 : 19/02-25 04:12 Delta Foxtrot
Posts: 431
|
Reply to #5:
Hey Christian, I'm not sure what happened on your end, but I copied all your "before" file names, copied and pasted from my post into a new Replace method, and it worked fine. Are you sure you didn't copy the space at the front of the Replace: string into the field? That's the only thing I can think of that would completely stop the conversion; otherwise you should at least see *some* changes. Can you post a screenshot? Anyway, I'm glad Miguel's method worked for you. So Cheers! :) BTW, I don't speak for my friend Miguel but if it was me I'd take the period out of the first parentheses. The * after \s is probably in case there are extra spaces hiding amongst the single spaces that are supposed to be there. I'm not sure why the period is there (it just means match *any* character, so it matches the space, and the \s* means match zero or more spaces if the period and \s* are there the \s* matches zero spaces. Best, DF |
#7 : 19/02-25 04:50 Christian O.
Posts: 6
|
Hi Delta Foxtrot, I've added 2 screenshots the first is Miguel's script and the second is your script maybe you see what I did wrong https://drive.google.com/file/d/1Ah67TGL4I5mGIDO v07vt2ntzDcP5VncF/view?usp=drive_link https://drive.google.com/file/d/1G65fJZx3RkR3qtM ViiQBF0iNIBKsNZMB/view?usp=drive_link |
#8 : 19/02-25 05:44 Delta Foxtrot
Posts: 431
|
Reply to #7:
Hey Christian, You can call me D :) You need to share those files. Right click on them, choose Share / Share, change the access. I just get access denied right now. Best, DF |
#9 : 19/02-25 06:49 Christian O.
Posts: 6
|
Hi D ^^
ok thanks for the info, I did it and it should be released now |
#10 : 19/02-25 07:44 Delta Foxtrot
Posts: 431
|
Reply to #9:
Yeah, I got nothin'... It all looks right, but with the file definitions you posted I keep getting the correct changes here. I have had this happen once before, but it was on filenames in mixed Russian and English with *really* long filenames; I always assumed one or both of those factors was to blame. The only thing I can think of is you might have extra spaces in your actual filenames; since Miguel's solution accounts for the possibility of multiple spaces that doesn't seem totally outlandish. And as I think about it I realize that there is actually something called a "non-printing space", which \s matches and a tap of the space bar doesn't. If someone else created the filenames, like a computer for instance, that is a possibility, no matter how unlikely. And since the forum only allows basic characters (not even most Alt+Number key characters) if you copied filenames and pasted them into your post that would strip non-printing characters out. Bottom line, if you really care about why it's not working it's worth a shot to convert the spaces between the parentheses into "\s*" entries. I'd be interested to know if that works, anyway... :) ^(<word:1>)\s*–\s*(<word:2>)\s*(.+)\s*(v[\d\.]+)\s*(.*)$ works for me just like the original did on this end. If you try it let me know the outcome. Best, DF |
#11 : 19/02-25 11:12 Miguel
Posts: 175
|
Reply to #5:
Hi Christian, The problem with the extra space can be corrected simply deleting \s*-\s*. My fault. Use this: (\w.+) – (\w+)\s+([^v]+?)\s+v(\d+\.\d+\.\d+)\s+MSFS\s+([\d-]+) Miguel |
#12 : 19/02-25 12:56 Delta Foxtrot
Posts: 431
|
Reply to #11:
Hey Miguel, Why wouldn't you just take out the period in the first parenthesis capturing group? That fixes the problem, and you still have the \s* configurations to grab any stray spaces. I was admiring your use of them, it's so easy to end up with an extra space here and there. :) Best, DF |
#13 : 19/02-25 13:05 Miguel
Posts: 175
|
Reply to #12:
Hi Delta, That was my first choice but I realized that was failing capturing MK-STUDIOS. Miguel |
#14 : 19/02-25 19:19 Christian O.
Posts: 6
|
Hi D, Hi Miguel :D
I don't understand a thing when you pass information to each other with your specialist knowledge :D but ok, you're the pros here too and I'm the noob ^^ anyway D, in response to your post, I tried your new script but it doesn't work for me either. https://drive.google.com/file/d/1C_6QJkBFQ23LN1r 6YBYO22uCyPnH33jj/view?usp=drive_link But please don't rack your brains any further... I have the target result that I need... By the way, thanks again to Miguel, I'm now using your new script and it works perfectly Have a great evening |