Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Delete Text files from a folder

Hi All,

How can i delete all Text Files from a particular folder in my machine by using Qlikview.

Example:

IN my machine D:\Data\TextFiles  folder having for 4 text files. Now i want to delete the files by using the Qlikview functionality.

How can i do it.

Thanks in advance.

Regards

Venkat

19 Replies
Not applicable
Author

Hi Ralf Becher,

Its working fine now by using your macro code. It was awesome.

Pls can you explain in detail of this code, that would be very useful to me.

Thanks in Advance.


Regards

Venkat

Not applicable
Author

Hi Ralf Becher,

How r u ?

When i using the below line then it is displaying an MessagePrompt. After clicking the button of "Override Security, Execute this Statement" the action is performing correctly.

execute cmd.exe /c del *.txt;

Whenever i reload it is displaying the Message same. After Clicking the button it is performing the our required action.  I attaching the image in below.

DeleteFilesfromFolder.PNG

How can i change the code for not to displaying MessagePrompt.

Thanks in advance.

Regards

Venkat

Not applicable
Author

Hi Ralf,

The Below line is to delete the Text files from a folder

execute cmd.exe /c del *.txt;

My New Task is:

Now i need to Move the Text Files from current Foldet to another Folder. This should be done by script in QVW file.

The Code shold be like above format.

How i can work on it ? If any idea regarding this.

Thanks in advance

Regards

Venkat

rbecher
MVP
MVP

Hi Venkat,

just use the 'move' command:

execute cmd.exe /c move *.txt target_folder;

You can execute any OS command..

- Ralf

Data & AI Engineer at Orionbelt.ai - a GenAI Semantic Layer Venture, Inventor of Astrato Engine
Not applicable
Author

Hi Ralf,

I am sorry for late reply,

What you said is working fine.  But it is always showing an PromptMessage after clicking on the "Override Security, Execute this Statement".

How i can make it not to display while reloading.

Do you have any idea on this.

Thanks in advance.

Regards

Venkat

swuehl
MVP
MVP

Hi Venkat,

what Version of QV do you run?

Have you checked out: http://community.qlik.com/message/73851#73851 ?

Not applicable
Author

Hi swuehl,

That really good. It helps me,  not to display that message everytime.

Once again Thank you.

Regards

Venkat

rbecher
MVP
MVP

19.08.png

Data & AI Engineer at Orionbelt.ai - a GenAI Semantic Layer Venture, Inventor of Astrato Engine
Not applicable
Author

Hi Ralf,

Thank you its working after checking the option in Edit Script .

Regards

Venkat

Not applicable
Author

Hi,

how to write macro code for copying the images(.bmp) from one folder(source folder) and paste into another folder(destination folder).

Any idea on this ?

Thanks in  advance.