With your help, would like achieve below
1. How to recursively search for specific files with specific extension with number suffix. (we cannot predict the number. But it should be only number 3-5 digits
e.g file2.ext456, file3.ext789, file4.ext111, file2.WSDL123 etc
2. Do nothing on files without number suffix
e.g file1.ext, file2.ext, file3.ext, file2.WSDL etc.
3. Rename the file (basically to remove the random # suffix) to something common.
e.g file2.ext.new, file3.ext.new, file4.ext.new,file2.WSDL.new etc
4. Zip each renamed file and copy the zip file to a common location we specify.
5. Prefer to have it as a function and call it multiple times for each extension pattern etc.
6. As of now, I have around 4000 files to process :)
Just a bit about the context.
I’m trying to compare oracle service bus artifacts (projects) between two export. When OSB OOTB export those projects. It give ransom suffix to certain files which tricks my comparison utility to identify those as new. Even though content within the file are identical. One way to resolve this is to rename those to same filename on both exports and then compare.
sample dir structure and files
Thanks in advance.