Renaming files based on source Tar file pattern
Posted: Thu Apr 14, 2016 6:08 pm
Hello community - I have a scenario where the files retrieved are TAR with pattern: "[constant]-<plant>-[constant]-<timestamp>.tar" and the files within the tar have the pattern: "<operation>-<step>.txt"
I would like to create a combination file name from the container (tar) and extracted files for the destination file name, so after the untar operation, rename the files so they are: <plant>-<timestamp>-<operation>-<step>.txt.
I am unable to determine how to obtain the file name of the TAR and then parse the parts I want (perhaps using a regex) to apply to the untar file group.
Thank you for any advice.
I would like to create a combination file name from the container (tar) and extracted files for the destination file name, so after the untar operation, rename the files so they are: <plant>-<timestamp>-<operation>-<step>.txt.
I am unable to determine how to obtain the file name of the TAR and then parse the parts I want (perhaps using a regex) to apply to the untar file group.
Thank you for any advice.