Renaming files based on source Tar file pattern
Post any question you may have in regards to GoAnywhere MFT and let our talented support staff and other users assist you.
If you need a quicker response, please create a support ticket via the customer portal my.goanywhere.com or contact our support team by email at [email protected].
If you need a quicker response, please create a support ticket via the customer portal my.goanywhere.com or contact our support team by email at [email protected].
2 posts
Page 1 of 1
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.
- Support Specialist
- Posts: 590
- Joined: Tue Jul 17, 2012 2:12 pm
- Location: Phoenix, AZ
-
Tadd,
The answer to your situation is just a bit of string manipulation.
More than likely, you're retrieving the file based on Date or availability. This means you going to 'get' the file from some location using a wildcard or date filter. Once you have the file locally, we can parse the filename with several attributes. (Name, Name without extension, date, size, last modified date, etc)
So, that gives us the information you need to parse your filename. That's done by functions available to you within the Workflow. So, parsing out values then re-assembling them for renaming of files can be done .. just takes putting in the logic.
This link will show you how to utilize file attributes as an example.
The answer to your situation is just a bit of string manipulation.
More than likely, you're retrieving the file based on Date or availability. This means you going to 'get' the file from some location using a wildcard or date filter. Once you have the file locally, we can parse the filename with several attributes. (Name, Name without extension, date, size, last modified date, etc)
So, that gives us the information you need to parse your filename. That's done by functions available to you within the Workflow. So, parsing out values then re-assembling them for renaming of files can be done .. just takes putting in the logic.
This link will show you how to utilize file attributes as an example.
Rick Elliott
Lead Solutions Consultant
(402) 944.4242
(800) 949-4696
Lead Solutions Consultant
(402) 944.4242
(800) 949-4696
2 posts
Page 1 of 1