How to create a folder for each file and move file to created folder?

for example : i want create a folder and move this files to the created folder

Hi @Narayana_Acharyulu ,

You can use the Create folder and Move Folder Activity inside the For each loop activity.

Thanks ,
Srihari

Hi,

Hope the following sample helps you.

Sequence.xaml (7.0 KB)

Regards,

@Narayana_Acharyulu

Try below mentioned steps.

  1. Use below expression to fetch all files from the folder.

       arrFiles = Directory.GetFiles("Folder Path")
    
  2. And then use For Each loop activity to iterate one by one file.

             For each item in arrFiles
                   Use Create Folder activity to create folder and assign folder path to one variable
                   Use Move File activity to move the file to newly created folder
    

HI @Narayana_Acharyulu

Try like this

  • Use For each file in folder activity
    • Create Folder give your path and folder name like
      - Path+Path.GetFileNameWithoutExtension(CurrentFile.Tostring)
    • Move file
      • Source : CurrentFile.ToString
      • Destination : Path+Path.GetFileNameWithoutExtension(CurrentFile.Tostring)

Here is the skeleton SS and the workflow
image

Main.xaml (8.9 KB)

Regards
Sudharsan

HI @Narayana_Acharyulu

Already the same topic has been created

I think your colleague got an answer with the same workflow as I suggested

Kindly close this topic after checking it in your side

Regards
Sudharsan

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.