#1 : 09/03-23 02:54 Tony
Posts: 1
|
Hi all,
I am hoping someone here can kindly help .. I wish to rename a sequence of files (5000 approx.) Where I first replace some of the pattern text then ( this is the difficult bit i don't know how ) remove all the numbers or remove them in another pattern batch, and enumerate them again sorting in the same order by date and time ... i think i will need the whole JavaScript course ))) if i had the time)))) Free Live music with Allie Jams - spotify and 11 more pages - Chaos - Microsoft​ Edge Free Live music with Allie Jams - spotify and 13 more pages - Chaos - Microsoft​ Edge 1 Free Live music with Allie Jams - spotify and 13 more pages - Chaos - Microsoft​ Edge 2 Free Live music with Allie Jams - spotify and 15 more pages - Chaos - Microsoft​ Edge 3 Free Live music with Allie Jams - spotify and 17 more pages - Chaos - Microsoft​ Edge ... also how do I make the pattern ignore the page numbers part? and then RENAMED TO : Free Live music with Allie Jams - Chaos Free Live music with Allie Jams - Chaos 1 Free Live music with Allie Jams - Chaos 2 Free Live music with Allie Jams - Chaos 3 Free Live music with Allie Jams - Chaos 4 back in the same order they were originally by date and time again? can any one help ... thanks for reading) |
#2 : 09/03-23 10:32 David Lee
Posts: 1125
|
If you can always use "-" as a separator then use a Replace method...
Replace: ([^-]*-)[^-]*-([^-]*)-[^\d]* with: \1\2 Use regular expressions This will leave a trailing space if there is no digit at the end of the filename. You can probably fix this by modifying the regex but a quick fix is to add a Remove pattern method... Pattern " $" (ie space + "$") Use regular expressions |