Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

souadouert
Contributor III

copy files

Hello !

I have a question the qlikview has the possibility from a script to copy folder files to another (windows copy paste)

1 Solution

Accepted Solutions
Not applicable

Re: copy files

Hello,

Here you go

Step 1 - enable script can execute external programs via "Edit script > Settings tab", screenshot below


Capture3.GIF

Step 2 - Allow database write and execute statements in script via "Settings > User Preferences > Security tab", screenshot below

Capture.GIF

Step 3 - Create script line as below. You will need to update highlighted bit though. In my example

C:\temp\*.txt (Source files path)

C:\temp\Archive (Target folder path)

Capture2.GIF

Step 4 - reload!

Give this a whirl and let me know how you get on.

Warm regards,

Nish

12 Replies
mwoolf
Honored Contributor II

Re: copy files

You can use the VB Script File System Object (FSO)

souadouert
Contributor III

Re: copy files

I am a beginner with qlikview, you can explain to me more

Not applicable

Re: copy files

Hello,

Here you go

Step 1 - enable script can execute external programs via "Edit script > Settings tab", screenshot below


Capture3.GIF

Step 2 - Allow database write and execute statements in script via "Settings > User Preferences > Security tab", screenshot below

Capture.GIF

Step 3 - Create script line as below. You will need to update highlighted bit though. In my example

C:\temp\*.txt (Source files path)

C:\temp\Archive (Target folder path)

Capture2.GIF

Step 4 - reload!

Give this a whirl and let me know how you get on.

Warm regards,

Nish

shankarece
Honored Contributor

Re: copy files

satheshreddy
Contributor III

Re: copy files

Hi Souad,

Yes, you can use copy paste from one QVW File script to one more  Qvw File,

but make sure the datasource  place is same.

Regards

Sathish

Re: copy files

Which file type you trying to copy ? and what should be the output format ?

if its a CSV to CSV,Excel ,TXT

TXT to TXT ,Excel ,CSV,TXT

Excel to Excel,CSV ,TXT

then without VB its possible ..

souadouert
Contributor III

Re: copy files

Good morning avinash i used

DIRECTORY;

t: load rand() AutoGenerate 100;

EXECUTE cmd.exe /C    move /Y      .\QVD\*.qvd     .\QVD_OLD ;

store t into .\QVD\t.qvd (qvd);

souadouert
Contributor III

Re: copy files

Hello nishant

thank y   So C an i Uses repetitive loop as for, while ...

For example, I want to save the folder names of a path in array and then I loop on that variable

souadouert
Contributor III

Re: copy files

thank y very helpful doc

Community Browser