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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to delete files in a tFileList iteration?

Hi
I have a scenario which must be very common.
I have a staging directory which I will automatically monitor for files.
When files are found (1 or more), I want to iterate through the found files, do some processing, and then move the processed file.
I am using a tFileList for the iteration.
My problem is that it seems impossible to do any operation that affects
the current file (tFileDelete or tFileCopy with "Remove source File" checked).
I get no errors, but the file is simply not deleted.

What is the best practice to remove processed files from the staging directory?

My env is TIS 2.4.1.r16077, I'm working in a Java project
Any advice appreciated
Labels (3)
6 Replies
Anonymous
Not applicable
Author

Hello
the current file (tFileDelete or tFileCopy with "Remove source File" checked).

tFileList--iterate-->tFileDelete
In the file name field, press ctrl+blank space, then select the global variable: tFileList_current_file_path
Best regards

shong
Anonymous
Not applicable
Author

Hi shong,
if after deletion i needed to do something without exiting from current iteration of tFileList, should it be possible to connect tFileDelete to a tRunJob?
I have tried whith a "main" connection, but it says "if this component has output, ther emust be an input link to propagate the data".
Which is silly , because i do not have any output.
What should i do?
Anonymous
Not applicable
Author

Hi,
onComponentOk should be the right connection.
Bye
Volker
Anonymous
Not applicable
Author

But, OnComponentOk is it still into the current TFileList iteration?
Does tFileList iteration wait for the subjob to be ended, if it is linked only with a onComponentOk ?
Anonymous
Not applicable
Author

Hi,
i thought about doing a branch. So you data flow (main) will go wherever it will be needed and onComponentOk will go to tFileDelete.
Will tFileDelete wait for tRunJob? Good question. I think onComponentOk is triggered after all actions of the components are done. And the last one is done at the end of the iteration. So it will wait for tRunJob.
Please correct me if I'm wrong.
Bye
Volker
_AnonymousUser
Specialist III
Specialist III

Hello,
I'm also running into the same issue with tFileDelete NOT deleting while no error returned.
Here's my flow, not sure if the order of the flow might be causing it not to Delete?

tFileList (iterate) --> tFileInputDelimited --> tMSSQLOutput --> tFileCopy --> tFileDelete (not deleting)
I can delete with a separate branch, but not sure why my flow above wouldn't delete? Any idea?

tFileList (iterate) --> tFileInputDelimited --> tMSSQLOutput --> tFileCopy
tFileList2 (iterate) --> tFileDelete2 (deleting)
However, if I use two separate branch, what do I need to do to call the second tFileList when the the first tFileList iteration actions are complete?
Your help is much appreciated!