Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Haresh
Contributor
Contributor

Is there a way to create a folder dynamically based on the first part of the filename in talend before copying the sftp file

I am downloading a file from the remote sftp site and based on the filename for eg:A_B_C.csv before using tfilecopy in talend to transfer the file onto a local folder,how can i create a new folder based on the first part of the filename just before delimiter_(folder called A in this case) and then copy the file onto the specific folder called A?

Or even a java code to parse the filename and extract only A field from the filename (A_B_C.csv) and create a folder/directory and then copy the retrieved file into the same folder

Somebody please help

 

1 Reply
manodwhb
Champion II
Champion II

@Haresh Sivakumar​ , based on the SFTP file you need to take first occurrence of _ what value do you have right?

 

you need to use tFTPfileproperties and get the filename and then do use the substring and index of function to get the portion of the file name then iterate using tflowtoiterate and then you create a directory and download the file.

 

Thanks,

Manohar