One Star

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
1 REPLY
Employee

Re: check file empty

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