Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a folder in my local computer called "Total". There is a subfolder "2018-10" under "Total" and there are a few subdirectories under "2018-10":
/Total/2018-10/Subfolder_A/ files
/Total/2018-10/Subfolder_B/ files
/Total/2018-10/Subfolder_C/ files
I need to add a folder "2018" on top of "2018-10" so the directories would be look like this:
/Total/2018/2018-10/Subfolder_A/ files
/Total/2018/2018-10/Subfolder_B/ files
/Total/2018/2018-10/Subfolder_C/ files
Can anybody give some advice? Thank you!
Hi,
Another idea is to archive the directory with its sub folders using tfilearchive functionality and copy the archive file to the new area. Once the archive file is present in the new directory, you can use tfileunarchive component to unzip the files.
The advantage of this method is that you need to do less amount of data transfer since its a zip file. So this will help you to complete the task if the data volume is high.
Please don't forget to select the sub directories and all files options in tfilearchive component. Similarly in tfileunarchive component, select extract file path option.
Below are the links for both the components.
https://help.talend.com/reader/WWQ40R_iTE5~~9VkUQrjgQ/~V42EBQClKxKQghNvzHF1g
https://help.talend.com/reader/WWQ40R_iTE5~~9VkUQrjgQ/7Bj99i9HHD~wcAItQuK9Zw
Could you please mark the topic as resolved so that it will help others in our Talend community?
Warm Regards,
Nikhil Thampi
Here is my current solution (with 3 steps):
l
1. Step 1: tCreateTemporaryFile
Directory: ((String)globalMap.get("tFileList_8_CURRENT_FILEDIRECTORY"))+"/"+((String)globalMap.get("FiscalYear"))
Create a directory "2018" under "Total", so there will be two subfolders under "Total" now:
/Total/2018/
/Total/2018-10/
2. Step 2: tFileCopy
check "Copy a directory"
Source directory: ((String)globalMap.get("tFileList_8_CURRENT_FILEDIRECTORY"))+"/"+((String)globalMap.get("FiscalPeriod"))
Destination directory:((String)globalMap.get("tFileList_8_CURRENT_FILEDIRECTORY"))+"/"+((String)globalMap.get("FiscalYear"))
3. Step 3: tFileDelete
Delete the subfolder "2018-10" under "Total"
File or Directory to delete: ((String)globalMap.get("tFileList_8_CURRENT_FILEDIRECTORY"))+"/"+((String)globalMap.get("FiscalPeriod"))
Please let me know if you have a better way to do it. Thanks!
TM
Hi,
Another idea is to archive the directory with its sub folders using tfilearchive functionality and copy the archive file to the new area. Once the archive file is present in the new directory, you can use tfileunarchive component to unzip the files.
The advantage of this method is that you need to do less amount of data transfer since its a zip file. So this will help you to complete the task if the data volume is high.
Please don't forget to select the sub directories and all files options in tfilearchive component. Similarly in tfileunarchive component, select extract file path option.
Below are the links for both the components.
https://help.talend.com/reader/WWQ40R_iTE5~~9VkUQrjgQ/~V42EBQClKxKQghNvzHF1g
https://help.talend.com/reader/WWQ40R_iTE5~~9VkUQrjgQ/7Bj99i9HHD~wcAItQuK9Zw
Could you please mark the topic as resolved so that it will help others in our Talend community?
Warm Regards,
Nikhil Thampi