cancel
Showing results for 
Search instead for 
Did you mean: 

Creation of Files in Separate folders

skodali
New Contributor III

Hello,

I’m trying to move/create files from folder to another folder based on the fileName.

Example: If I have 1) Test_001.pdf
2) Test_001.xml
3)Test_002.pdf
4) Test_002.xml files in a folder. The expected result
Folder Test001: 1) Test_001.pdf
2) Test_001.xml
Folder Test002: 1) Test_002.pdf
2) Test_002.xml

Can anyone suggest how should I approach to resolve this?

Thanks

3 REPLIES 3

aleung
Contributor III

What protocol are you referring to? SFTP/S3/smb/etc…?

skodali
New Contributor III

I’m using SFTP Protocol

Ajay_Chawda
Contributor

Hi Sasank ,
You can use below expression to create target path
_directoryPath+“/”+$Name.substring(0,$Name.length-4)+‘/’+$Name this will help you to create target path.
where direcotrypath = sldb:///abc/org/test
eg:- Name :- test1_001.csv
then target path= sldb:///abc/org/test/test1_001/test1_001.csv