Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

how to delete file?

hello guys [:)]

I have a question and I think ( and hope) that it quite simple to done.

I'm loading data from an EXCEL file.

after loading the file I want to delete it from the directory its located,how can I do that from that script?

Is it possible to move it to another directory instead of deleting it?

Do I need to use a batch file? ( I really prefer not to)

10X

David

16 Replies
Not applicable
Author

Hi Michael,

I am trying the same thing you did. I have got a working batch file (if I execute it manually) in the same directory as the .csv I want to move after reload. But when I put

EXECUTE C:\QlikView Storage\Private Data\Datasources\Input\TMS\ConfigLijst\move.bat;


in my script it won't move the file. My batchfile looks like this:


@echo off
move /Y "*.csv" "old\"
echo on


The reload window says done but nothing happens! When I put the QlikView application in the same folder as the .bat and remove the path it does work...

Is there something wrong with the way I call the path?

Regards, Sander

Anonymous
Not applicable
Author

Hi Sander,
It's hard to tell what's going on... If EXECUTE doesn't work - check the conditions I've mentioned above. If that batch file doesn't work - see if it executes manually. Also makes sense to check if there are security restrctions on files and folders.

Not applicable
Author

Hi Michael,

Thanks for your response. I don't know how but the problem is solved.. The only thing I can imagine is that the relative path I defined wasn't processed ok.. Manual execution did work ok, I had checked that.. It was in QlikView or the script.

Anyway.. Your solution does the trick, even in Publisher. Thanks!

Regards, Sander

bradshields
Partner - Creator
Partner - Creator

I had trouble with the path statement too. I moved the .bat file i wanted to execute to the same folder as the .qvw and I also renamed the .bat file to have no spaces. Also make sure you check to allow script (Allow Database Write and Execute Statement) under Settings User Preferences

juan_c_martinez
Contributor III
Contributor III

Thanks  Rakesh! It works fine!

Not applicable
Author

Hi Rakesh

Could not open the thread.

Could you Please send the Batch file to delete and archive the files.

Also I tired you QVW its deleting the files But could I archive the files also.

madushanfernand
Contributor III
Contributor III

hi 

this works perfect. but can we have a function to open another qvw using a function like this.?