I have my source file in .dat format in location \\filer3\equiprd\reports\interco\MI but it changes to some .dat.gz format after 6 days. So I want to copy these file into another location \\delr2\rp\FDR\Desktop\TLM CCY\Export.
If your .dat files are text-based you could could do a simple load and store sequence for each file in the directory:
LET vInputFolder = '\\filer3\equiprd\reports\interco\MI\'; LET vInputExtension = '.dat'; LET vOutputFolder = ' \\delr2\rp\FDR\Desktop\TLM CCY\Export\';
For each vFile in FileList('$(vInputFolder)' & '*' & '$(vInputExtension)')
CURRENT_FILE: LOAD * FROM [$(vFile)] (txt, delimiter is spaces);
LET vOutputPath = Replace('$(vFile)', '$(vInputFolder)', '$(vOutputFolder)');
STORE CURRENT_FILE into [$(vOutputPath)] (txt, delimiter is spaces); DROP TABLE CURRENT_FILE;
NEXT vFile;
LET vInputFolder=; LET vInputExtension=; LET vOutputFolder=; LET vOutputPath=;