Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Coming your way, the Qlik Data Revolution Virtual Summit. October 27-29. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator III
Creator III

Check if file existed and delete

Hello All,

I have a requirement to store the table contents into csv files  if they have data. Everyday the file gets overwritten.\

Table:

LOAD *  Resident Temp;

if NoOfRows('Table')>0 then

STORE Table into Table.csv(txt);

end if

If there is data in the table today, the file gets created but what if I do not have data tomorrow. The file would still be there in the folder. Is there anything I can do to check if file existed and delete before creating a new one?

1 Solution

Accepted Solutions
Highlighted
MVP & Luminary
MVP & Luminary

You could include the following in your logic:

if filesize('Table.csv') > 0 then

     EXECUTE cmd.exe /C del Table.csv;

end if

- Marcus

View solution in original post

2 Replies
Highlighted
MVP & Luminary
MVP & Luminary

You could include the following in your logic:

if filesize('Table.csv') > 0 then

     EXECUTE cmd.exe /C del Table.csv;

end if

- Marcus

View solution in original post

Highlighted
Creator III
Creator III

Thank you!