Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I would like to archive files that can be found in subfolders that follow this structure : {base_path}/yyyy/mm/dd and in those folders I have multiple files formatted like {doc_type}_yyyyMMdd-HH_{doc_id}.json (timestamp corresponds to the date present in the document - the creation date, let's say) that need to be archived.
eg:
Folder :
{base_path}/2019/07/05 :
The resulted *.zip file should be
{base_path}/to_archive/2019/07/05/{doc_type}_yyyyMMdd-hhmmss.zip (where the timestamp is for executon date this time)
Folder :
{base_path}/2021/08/06 :
The result : {base_path}/to_archive/2021/08/06/{doc_type}_yyyyMMdd-hhmmss.zip
How can iterate the base folder and get the *.json files present in those sub-folders ? Can I use some some sort of path masking ?
I already generated the *.json files and their specific folder structure, and now what I need to do is making the *.zip archive for each sub-folder and place it to the correct location.
I am thinking of using the component tFileArchive, but will it be enough ? Or another component needs to be before this one so that I can apply&load the *.json files?
Thank you !
Hi
Check the option 'include subdirectories' will include all subdirectories. My idea is to select the FileList type as Directory to iterate directory only, filter the directory path which only meet the folder structure like {base_path}/2021/08/06, these folder will be archived. Before tFileArchive, need a tJava to parse the folder path, extract the values like 2021, 08, 06 from folder path, store these value to context variables for used later as archive file path.
Regards
Shong