Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
arpita
Contributor III
Contributor III

Copy File from one location to another

Hi,

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.

Can someone help me with the script

 

1 Reply
haskia
Partner - Contributor III
Partner - Contributor III

Hi Arpita,

This has been asked a few times in the community. A quick search returned this post with links to additional posts.

https://community.qlik.com/t5/QlikView-App-Dev/Copy-Files/m-p/1020886

Make sure to check the Requirements of EXECUTE  😉 

 

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=;