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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
_AnonymousUser
Specialist III
Specialist III

check file empty

Hello everybody! Can I check in some way if a csv file is empty or not and if empty delete it?

Thanks in advance.
Giuseppe
Labels (3)
1 Reply
Anonymous
Not applicable

Hi giuseppe,
You could try to read data from it, and then if row_count = 0 then use a tFileDelete.
It would look like that:
tFileInputDelimited ---------> tJavaRow (Don't need to put anything in there)
|
|
On Subjob OK
|
|
v
tJava (Don't need to put anything in there)
|
|
If tFileInputDelimited_row_count == 0 (Not sure about the variable name, type the name of the component and then press CTRL + Space to display the list of variables for that component)
|
|
v
tFileDelete