Hi,
I'm using the following to copy a specific file to a directory and it works well:
GetFileList>C:\temp\sally\jda*.xls,files
Separate>files,;,file_names
Day>the_day
Month>the_month
Year>the_year
Let>thisday=%the_year%%the_month%%the_day%
Let>k=0
Repeat>k
Let>k=k+1
FileDate>file_names_%k%,fdate
if>fdate=thisday,copyfile
Goto>continue
Label>copyfile
CopyFile>file_names_%k%,C:\Temp\Sally\Archive
Label>continue
endif
Until>k,file_names_count
There are quite a few other specific files that I need to copy. Other than using the above for every file is there anyway that it can be simplified?.
thx,
John
GetFileList
Moderators: Dorian (MJT support), JRL
Let>filelistsource=C:\temp\sally\jda*.xls
Let>filelistdestination=C:\Telmp\Sally\Archive
GoSub>performarchive
Let>filelistsource=C:\temp\jessie\xyz*.doc
Let>filelistdestination=C:\Telmp\jessie\Archive
GoSub>performarchive
Let>filelistsource=C:\temp\raphael\abc*.jpg
Let>filelistdestination=C:\Telmp\raphael\Archive
GoSub>performarchive
Goto>very_end
SRT>performarchive
GetFileList>%filelistsource%,files
Separate>files,;,file_names
Day>the_day
Month>the_month
Year>the_year
Let>thisday=%the_year%%the_month%%the_day%
Let>k=0
Repeat>k
Let>k=k+1
FileDate>file_names_%k%,fdate
if>fdate=thisday,copyfile
Goto>continue
Label>copyfile
CopyFile>file_names_%k%,%filelistdestination%
Label>continue
endif
Until>k,file_names_count
End>performarchive
Label>very_end
Let>filelistdestination=C:\Telmp\Sally\Archive
GoSub>performarchive
Let>filelistsource=C:\temp\jessie\xyz*.doc
Let>filelistdestination=C:\Telmp\jessie\Archive
GoSub>performarchive
Let>filelistsource=C:\temp\raphael\abc*.jpg
Let>filelistdestination=C:\Telmp\raphael\Archive
GoSub>performarchive
Goto>very_end
SRT>performarchive
GetFileList>%filelistsource%,files
Separate>files,;,file_names
Day>the_day
Month>the_month
Year>the_year
Let>thisday=%the_year%%the_month%%the_day%
Let>k=0
Repeat>k
Let>k=k+1
FileDate>file_names_%k%,fdate
if>fdate=thisday,copyfile
Goto>continue
Label>copyfile
CopyFile>file_names_%k%,%filelistdestination%
Label>continue
endif
Until>k,file_names_count
End>performarchive
Label>very_end
-
- Pro Scripter
- Posts: 50
- Joined: Fri Mar 23, 2007 10:14 am
GetFileList
Gary,
Thx, that looks gr8 --- very simple even for me
Thx, that looks gr8 --- very simple even for me
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Goto>very_end and Label>very_end are not needed. The subroutine will only be executed if it is called.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?