Take a file, rename it and copy it to a new location


#1

I am trying to get path of file txt, rename it in the date time format and copy the file to the new location. In my code
vplace = system.io.directory.getfiles(“path”) using this I am getting the path

Vplace is declared as string []

When i am trying to copy, I am putting the from path as vplace.ToString

It is not working, I am getting the error "Source copy file
Message : Could not find file System String[]


#2

Use Copy File Activity


#3

#4

Thanks for the reply

my file will be a downloaded one and name of the file will random so I want to extract the file name from the path and procced. In your I could see that the file name is already defined


#5

Thanks for the reply

Can you pls provide the steps


#6

Okay DO the following steps

  1. Files[] = Directory.GetFiles(<Required_Folder_Path>)
  2. Fore each FILE in Files[]
  3. Use Copy File activity Path= FILE & Destination= New_Folder_Path + Path.GetFileName(FILE)

It’s done!


#7

Thanks, now it is working


#8

Great!