Take input of user and create multiple copies of one file

Hi All, I want something where user can put input no. And create a multiple copies of that files.

@Pramod_Sharma … could you please elaborate about your requirement and the expected output ?

For example i have one file name of “test1.html”. and i want to copy it multiple time according to the input give by user like if i entered 15 so it will copy 15time same file with sequence no. test1 test2 test3… so on

Yess @Pramod_Sharma… I think you can achieve this by using O/P variable of Input Dialogue box, While loop and Copy File activities.
To give you a starter you can do like this:

  1. Get the input value form the user store that value in variable(InputVar Int 32 type).
  2. Use that variable in the while loop with condition Itr <= InputVar.
  3. With copy file activity use the this expression in the destination filed: “test”+Itr.ToString+".html"
  4. Finally increment the Itr value.

Hope this make some sense to start your workflow.

Cheers!

1 Like

Ok let me try these… Thanks for the help…:grinning:

@Pramod_Sharma - Please find some starter help here…

For Each : Enumerable.Range(1,IntNooftimes) - This will loop 1 to UserInputTimes…

I have used Index which comes along with For Each, if you use this then you dont have additional variable to increment . this you can use it as Counter. But note, Idx always starts with 0.

Copy File --> To --> “OutputPath” + path.GetFileNameWithoutExtension(“InputFilePath”) + (idx+1).ToString + path.GetExtension(“InputFilePath”)…

Output
I have entered 3…
image

1 Like

Thank u sir let me try this on Monday in a live project…:slightly_smiling_face: