Forum Discussion

skodali's avatar
skodali
New Contributor III
7 years ago

Creation of Files in Separate folders

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

  • 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

  • aleung's avatar
    aleung
    Contributor III

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