Linux bash script removing specific string from filename and everything afterwards while keeping everything before string intact.
€8-30 EUR
Teljesítve
Kiadva ekkor: több mint 5 évvel ezelőtt
€8-30 EUR
Teljesítéskor fizetve
1000+ files all in the same folder that need renaming.
Examples:
[login to view URL] > [login to view URL]
[login to view URL] [login to view URL] > [login to view URL] [login to view URL]
even morerandom-Danish [login to view URL] > even [login to view URL]
[login to view URL] > [login to view URL]
more random DANISH even more [login to view URL] > more [login to view URL]
As the Examples above the trigger word is always "Danish" that very in upper and lower case. Also sometimes a sign or space just before "Danish" need to be removed so files wont end up like random2..avi, [login to view URL] or random2 .avi
If "Danish" missing from filename ill like the script to check for the following instead and also delete everything afterwards, but unlike danish keep the season, episode or date and again everything before intact:
s01e01
S01E01
e01
E01
20180925
25092018
2018-09-25
25-09-2018
The above can of cause vary depending on the season, episode or date. If Danish or the above is missing, skip the file.
hi,
This kind of string pattern matching should be using Perl to do. I can give your a final utility scrip like:
[login to view URL] [DIR].# If you don't give a dir, it will scan the $PWD - current dir.
I can draft a script in one day, and you can test at your side on the next day. Until you are happy with the result, you can award me to do the task then.
Regards,
--T