Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

How to overwrite csv output file if exists

Pankhudri20
8 - Asteroid

Hello,

 

I am running a workflow where it extracts data from SAP HANA Studio and output csv files weekly. The filename is based on the week and year.

However, if I run the workflow twice in the same day it output the same week file twice.

Is there a way to check if the csv is already in the folder then either skip that week or overwrite.

Any help would be greatly appreciated.

 

Thank you

Regards,

Pankhudri Agrawal

2 REPLIES 2
Garabujo7
Alteryx
Alteryx

Hello @Pankhudri20 ,

 

You could use this:

 

Garabujo7_1-1634938848363.png

 

 

With a formula to look for the file name:

 

Garabujo7_2-1634938862715.png

 

If it exists will return true, else false.

 

Then filter. If it's false, write the output. If not, send a message.

 

Garabujo7_4-1634938936064.png

 

 

Gabriel

danilang
19 - Altair
19 - Altair

Hi @Pankhudri20 

 

You can't write a file to a directory with exactly the same name twice.  If the file already exists, the new version will overwrite the existing file if existing file isn't locked.  If it is locked, you'll get an error.

 

If you're getting two files written to the same subdirectory, they must have different names.  Possibly the time is included in the filename.  Can you show us a screen shot of a case where the file is written more than once.

 

Dan

Labels