Renaming two files in a folder/subfolder structure
Hello,
I want to rename only the following two files that exist in many folders and subfolders:
RouteProperties.xml => RouteProperties.xml.LSoff
MainContent.ap => MainContent.ap.LSoff
I would also like to rename the new name back to the original name.
Strangely enough, I am unable to do this using the 'replace' or 'replacement list' method.
I have tried to do this after saving both methodlists like LSoff-ON.aren and LSoff-OFF.aren
with two method lines 'Replace' for both files and separate with the method 'Replacelist' also with the mentioned two files.
What am I doing wrong and what is a good solution for this?
Thanks in advange for a solution.
I want to rename only the following two files that exist in many folders and subfolders:
RouteProperties.xml => RouteProperties.xml.LSoff
MainContent.ap => MainContent.ap.LSoff
I would also like to rename the new name back to the original name.
Strangely enough, I am unable to do this using the 'replace' or 'replacement list' method.
I have tried to do this after saving both methodlists like LSoff-ON.aren and LSoff-OFF.aren
with two method lines 'Replace' for both files and separate with the method 'Replacelist' also with the mentioned two files.
What am I doing wrong and what is a good solution for this?
Thanks in advange for a solution.
Reply to #1:
Hi Jaap,
Not sure what the problem is; I can do it just as you say with two replace methods. Make sure the "Apply to:" fields are set for "Name and extension"?
If that's not the problem a screenshot or two might help... also what exact result you get, i.e., "nothing happens" or "one file gets changed but not the other" or "they're changed, but it's not correct"...
I'm assuming you are specifying "Add the files in the folders" and "Include subfolders" when you load the files (by dragging directories).
Best,
DF
Hi Jaap,
Not sure what the problem is; I can do it just as you say with two replace methods. Make sure the "Apply to:" fields are set for "Name and extension"?
If that's not the problem a screenshot or two might help... also what exact result you get, i.e., "nothing happens" or "one file gets changed but not the other" or "they're changed, but it's not correct"...
I'm assuming you are specifying "Add the files in the folders" and "Include subfolders" when you load the files (by dragging directories).
Best,
DF
Reply to #2:
Hello DF,
The Apply to fields where set to 'Name and extension.
I want to replace the files RouteProperties.xlm to RouteProperties.xls.LSoff and MainContent.ap
to MainContent.ap.LSoff
When I drag or select the root folder all correspondending files that end with .xlm or .ap are shown,
but the part before teh extension is ignored, so many other files that have the same suffix are shown.
How can this ignoration exist? Yes the wanted replacement for the Route... and Main... files give the text 'Extension is changed' and the not wanted files are not changed with the error text 'OK'
The screenshots:
https://postimg.cc/gallery/dqsHC71
[url=https://postimg.cc/t17s3qph][img]https://i.postimg.cc/t17s3qph/Method-1.png[/img][/url]
[url=https://postimg.cc/cK6vRx0R][img]https://i.postimg.cc/cK6vRx0R/Method-2a-and.png[/img][/url]
[url=https://postimg.cc/4KMmwDxn][img]https://i.postimg.cc/4KMmwDxn/Method-2b.png[/img][/url]
Hello DF,
The Apply to fields where set to 'Name and extension.
I want to replace the files RouteProperties.xlm to RouteProperties.xls.LSoff and MainContent.ap
to MainContent.ap.LSoff
When I drag or select the root folder all correspondending files that end with .xlm or .ap are shown,
but the part before teh extension is ignored, so many other files that have the same suffix are shown.
How can this ignoration exist? Yes the wanted replacement for the Route... and Main... files give the text 'Extension is changed' and the not wanted files are not changed with the error text 'OK'
The screenshots:
https://postimg.cc/gallery/dqsHC71
[url=https://postimg.cc/t17s3qph][img]https://i.postimg.cc/t17s3qph/Method-1.png[/img][/url]
[url=https://postimg.cc/cK6vRx0R][img]https://i.postimg.cc/cK6vRx0R/Method-2a-and.png[/img][/url]
[url=https://postimg.cc/4KMmwDxn][img]https://i.postimg.cc/4KMmwDxn/Method-2b.png[/img][/url]
Reply to #3:
I'm sorry Jaap, but I still don't understand. It looks like (first screenshot, last image) ARen is doing just what you asked: ignoring non-conforming files and changing the files you want changed. What am I missing?
If it's just a case of getting ARen to ignore files you don't want to see, try using this regular expression in the "regular expression match:" field when you drag the folder:
(RouteProperties|MainContent)\.(ap|xml)\.LSoff
for ending in "LSoff", or
(RouteProperties|MainContent)\.(ap|xml)
for adding LSoff.
https://drive.google.com/file/d/1UyMIvKgSv7F5UqYY8xFqIAEhDje ItAiJ/view?usp=sharing
Good luck,
DF
I'm sorry Jaap, but I still don't understand. It looks like (first screenshot, last image) ARen is doing just what you asked: ignoring non-conforming files and changing the files you want changed. What am I missing?
If it's just a case of getting ARen to ignore files you don't want to see, try using this regular expression in the "regular expression match:" field when you drag the folder:
(RouteProperties|MainContent)\.(ap|xml)\.LSoff
for ending in "LSoff", or
(RouteProperties|MainContent)\.(ap|xml)
for adding LSoff.
https://drive.google.com/file/d/1UyMIvKgSv7F5UqYY8xFqIAEhDje ItAiJ/view?usp=sharing
Good luck,
DF
Reply to #4:
Hello DF,
Thank you for replying, but I have tried adding the regular expression as well with the method 'Replace' and 'List replace' but the screen keeps empty.
Removing the regular expression, all files with suffix . xml or .ap are shown and for the files that match 'RouteProperties.xml' or 'MainContent.ap' the suffix is changed, while the other files keep the suffix .xml or .ap
The question is, why is the parts before the suffix are IGNORED in both methods?
Am I misinterpreting the operation, or is this a possible bug?
A solution to remove the files mentioned in the above line is to use the menu item
Remove special => Remove unchanged items
Screenshots:
https://postimg.cc/gallery/gwBFjX2
https://i.postimg.cc/JGFH9NGF/Add-items.png
https://i.postimg.cc/Vdh03qdG/Method-List-replace.png
https://i.postimg.cc/9rkwvdrg/Method-replace.png
Thanks for helping me,
Jaap
Hello DF,
Thank you for replying, but I have tried adding the regular expression as well with the method 'Replace' and 'List replace' but the screen keeps empty.
Removing the regular expression, all files with suffix . xml or .ap are shown and for the files that match 'RouteProperties.xml' or 'MainContent.ap' the suffix is changed, while the other files keep the suffix .xml or .ap
The question is, why is the parts before the suffix are IGNORED in both methods?
Am I misinterpreting the operation, or is this a possible bug?
A solution to remove the files mentioned in the above line is to use the menu item
Remove special => Remove unchanged items
Screenshots:
https://postimg.cc/gallery/gwBFjX2
https://i.postimg.cc/JGFH9NGF/Add-items.png
https://i.postimg.cc/Vdh03qdG/Method-List-replace.png
https://i.postimg.cc/9rkwvdrg/Method-replace.png
Thanks for helping me,
Jaap
Reply to #5:
Hi forum members,
Has anyone a suggesties or solution for my issue?
@Kim: can you help me?
Hi forum members,
Has anyone a suggesties or solution for my issue?
@Kim: can you help me?
Reply to #6:
Hi Jaap,
You need to set the "Filename mask" to *.*
See: https://imgur.com/a/2nRmbpE
For the "Regular expression match" you would use:
^[RM][^\.]+\.(ap|xml)$
or
^[RM][^\.]+\.(ap|xml)\.LSoff$
depending on what you are doing.
Regards,
Randy
Hi Jaap,
You need to set the "Filename mask" to *.*
See: https://imgur.com/a/2nRmbpE
For the "Regular expression match" you would use:
^[RM][^\.]+\.(ap|xml)$
or
^[RM][^\.]+\.(ap|xml)\.LSoff$
depending on what you are doing.
Regards,
Randy
Reply to #7:
Hi Randy,
Thanks for your regex contribution, but despite the regex, still to many files
that are not relevant for renaming the two suffixes are shown.
See the screenshot: https://postimg.cc/87wHbzRg
Why are the parts RouteProperties.xml and MainContent.ap before theyre extensions
ignored in the two 'replace' methods?
Hi Randy,
Thanks for your regex contribution, but despite the regex, still to many files
that are not relevant for renaming the two suffixes are shown.
See the screenshot: https://postimg.cc/87wHbzRg
Why are the parts RouteProperties.xml and MainContent.ap before theyre extensions
ignored in the two 'replace' methods?
Reply to #8:
That screenshot shows that those files were there before you tried using the (new) regex. Clear the filelist and add the files using the correct regex.
Also, you have a typo in your regex. Cut and paste from one of the two lines I gave above please.
Anyway the regex works perfectly for me (Version 4.20). What version of Aren are you using?
Best of luck,
Randy
That screenshot shows that those files were there before you tried using the (new) regex. Clear the filelist and add the files using the correct regex.
Also, you have a typo in your regex. Cut and paste from one of the two lines I gave above please.
Anyway the regex works perfectly for me (Version 4.20). What version of Aren are you using?
Best of luck,
Randy
Reply to #9:
Hi Randy,
After correcting the typo in the regex, this works almost perfect.
But still a few unwanted files are selected and visible due ^[RM] ( I suppose), because I have no knowledge of regex.
Please see the resulting screenshot: https://postimg.cc/NKBFDXmq
Is it possible to ignore those files with regex?
Hi Randy,
After correcting the typo in the regex, this works almost perfect.
But still a few unwanted files are selected and visible due ^[RM] ( I suppose), because I have no knowledge of regex.
Please see the resulting screenshot: https://postimg.cc/NKBFDXmq
Is it possible to ignore those files with regex?
Reply to #10:
Hello again Jaap,
Yes, a more restrictive regex would be:
^(MainContent\.ap|RouteProperties\.xml)$
or
^(MainContent\.ap|RouteProperties\.xml)\.LSoff$
Good luck,
Randy
Hello again Jaap,
Yes, a more restrictive regex would be:
^(MainContent\.ap|RouteProperties\.xml)$
or
^(MainContent\.ap|RouteProperties\.xml)\.LSoff$
Good luck,
Randy
Reply to #11:
Hello Randy,
Thanks for this change in the Regex.
But describing the full file names in the Regex is exactly what I have used
in the two ‘Replace’ and ‘ List replace’ Methods I used without using Regex.
So why does the addition of the Regex results in what I expected and without the Regex not.
I assume that most people have no knowledge of Regex like me.
Hello Randy,
Thanks for this change in the Regex.
But describing the full file names in the Regex is exactly what I have used
in the two ‘Replace’ and ‘ List replace’ Methods I used without using Regex.
So why does the addition of the Regex results in what I expected and without the Regex not.
I assume that most people have no knowledge of Regex like me.
Reply to #12:
Hello Jaap,
I cannot see the full exact regex you used at first.
But as we've seen,
(A) Every character of a regex is critical
(B) you also needed to set the "Filename mask"
For a detailed explanation of the regex, see:
https://regex101.com/?regex=%5E%28MainContent%5C.ap%7CRouteP roperties%5C.xml%29%5C.LSoff%24&testString=MainContent.a p%0AMainContent.ap.LSoff%0ARouteProperties.xml%0ARouteProper ties.xml.LSoff%0A31-05-2026+Sportsingel.xml%0A&flags=gm& amp;flavor=pcre2&delimiter=%2F
Hello Jaap,
I cannot see the full exact regex you used at first.
But as we've seen,
(A) Every character of a regex is critical
(B) you also needed to set the "Filename mask"
For a detailed explanation of the regex, see:
https://regex101.com/?regex=%5E%28MainContent%5C.ap%7CRouteP roperties%5C.xml%29%5C.LSoff%24&testString=MainContent.a p%0AMainContent.ap.LSoff%0ARouteProperties.xml%0ARouteProper ties.xml.LSoff%0A31-05-2026+Sportsingel.xml%0A&flags=gm& amp;flavor=pcre2&delimiter=%2F
Reply to #13:
Hello Randy,
I have copied the regex => ^(MainContent\.ap|RouteProperties\.xml)\.LSoff$
from your URL above.
But using the method 'Replace' see or 'List replace' give no result after selecting the root folder
after pasting the regex above.
The result window was cleaned up before this.
See my screenshots:
https://postimg.cc/gallery/Kz8KHy3
Hello Randy,
I have copied the regex => ^(MainContent\.ap|RouteProperties\.xml)\.LSoff$
from your URL above.
But using the method 'Replace' see or 'List replace' give no result after selecting the root folder
after pasting the regex above.
The result window was cleaned up before this.
See my screenshots:
https://postimg.cc/gallery/Kz8KHy3
Reply to #14:
Dear Jaap,
1) The regex I gave you was just for adding the files. Not the renaming bit.
2) Both sets of regex work perfectly. I tested them. And, your own screenshot shows the first set working for you -- even though it did pick up a small fraction of unwanted files.
3) The screenshots of your replace methods *seem* correct but I cannot confirm that there are no leading/trailing spaces and no stray Unicode characters.
4) Please remember that all the rename methods and the file-add regex will fail if the cases do not match exactly or if there are any spaces or "invisible" characters.
Is it possible that you inadvertently introduced one of the problems of item 4 -- or any other misspelling -- when you renamed the files in those folders?
You can use Aren's "Undo batch" command to reset all such files and try again.
We are rapidly approaching the limits of the help we can provide via forum or email.
But what you appear to be trying is well within Aren's capabilities and works fine for me. Bust out a magnifying glass and verify exact characters, exact letter-case, and no spaces present.
Good luck,
Randy
Dear Jaap,
1) The regex I gave you was just for adding the files. Not the renaming bit.
2) Both sets of regex work perfectly. I tested them. And, your own screenshot shows the first set working for you -- even though it did pick up a small fraction of unwanted files.
3) The screenshots of your replace methods *seem* correct but I cannot confirm that there are no leading/trailing spaces and no stray Unicode characters.
4) Please remember that all the rename methods and the file-add regex will fail if the cases do not match exactly or if there are any spaces or "invisible" characters.
Is it possible that you inadvertently introduced one of the problems of item 4 -- or any other misspelling -- when you renamed the files in those folders?
You can use Aren's "Undo batch" command to reset all such files and try again.
We are rapidly approaching the limits of the help we can provide via forum or email.
But what you appear to be trying is well within Aren's capabilities and works fine for me. Bust out a magnifying glass and verify exact characters, exact letter-case, and no spaces present.
Good luck,
Randy
Reply to #15:
Hello Randy,
After reading your steps in message #14, I started from scratch
filling the methods and after selecting the root folder and copy/paste the
regex => ^(MainContent\.ap|RouteProperties\.xml)$
it finally results as wanted.
https://postimg.cc/BPqSd48S
Thanks for your patience and solution.
I will spent some time (I'm retired) to learn working with Regex.
Bye,
Jaap
Hello Randy,
After reading your steps in message #14, I started from scratch
filling the methods and after selecting the root folder and copy/paste the
regex => ^(MainContent\.ap|RouteProperties\.xml)$
it finally results as wanted.
https://postimg.cc/BPqSd48S
Thanks for your patience and solution.
I will spent some time (I'm retired) to learn working with Regex.
Bye,
Jaap
Reply to #16:
Hallelujah! \o/
Hallelujah! \o/
Reply to #17:
Congrats and good work to both youze guys... Have you tried 4.21 yet?
Best
DF
Congrats and good work to both youze guys... Have you tried 4.21 yet?
Best
DF
Reply to #18:
Jeez DF,
Are you trying to get this thread into triple-digit posts?! ;P
Yes. I just loaded 4.21 and I must say it's ruined, *RUINED I say* because not all of the bugs were fixed in it. (^_^)
I do love the "Default method configuration: Blank" setting though. I just wish it blanked the whole method list as well.
Regards,
Randy
Jeez DF,
Are you trying to get this thread into triple-digit posts?! ;P
Yes. I just loaded 4.21 and I must say it's ruined, *RUINED I say* because not all of the bugs were fixed in it. (^_^)
I do love the "Default method configuration: Blank" setting though. I just wish it blanked the whole method list as well.
Regards,
Randy
Reply to #19:
Jeez, Randy,
> Are you trying to get this thread into triple-digit posts?!
Is that even possible??? LOL
Jeez, Randy,
> Are you trying to get this thread into triple-digit posts?!
Is that even possible??? LOL