I have a data flow I'm working on but need help on one piece of it. At a certain point I will have a directory with five (5) files in it. Next the data flow will delete one of those files...we'll call it "File_20200715_05.txt" and replace it with a generic file called "File_05.txt".
Now I need to rename the generic file, "File_05.txt", with the name of the previous file...which is dynamic. In the directory I have four other files with a similar naming convention which in theory I could use to rename the new file:
- File_20200715_01.txt
- File_20200715_02.txt
- File_20200715_03.txt
- File_20200715_04.txt
I'm wondering if there is a way to utilize one of those to capture everything before the final _##.txt and rename my current "File_05.txt" to "File_20200715_05.txt". Any thoughts or suggestions are appreciated?
Thank you!