Toad World® Forums

Copy activity not renaming the file


#1

Toad Data Point version: 4.3.0.718 (32 bit)

Im trying to copy an excel file to another location. The original file name has a date suffix that will change each month so I need to be able to look for a wildcard file name and then copy it. I also want to change the name of the file once it has been copied to the new location.

I have been following the instructions found here:
http://dev.toadfordataanalyst.com/webhelp/Content/Automation/Use_File_Automation_Activities.htm

I am using an asterisk to wildcard the file name in the Source File field and have given it a new name to assign to the file in the "Copy name" section.

The copy activity works fine, however the problem Im having is that it retains the original file name....it wont rename it to the new name.

There is no other file in the source folder.


#2

Let me have QA test this and see what they find.


#3

Unfortunately you cannot rename files when using wildcard in Copy File activity.
I would suggest to create batch file and execute it using Run Program activity.

Batch file example if you want static filename:
for %%I in (*.xlsx) do copy %%I c:\copy\newfile.xlsx

Or combination of text and original filename:
for %%I in (*.xlsx) do copy %%I "c:\copy\copy of %%I"


#4

okay thanks. Please let me know what they find out.