Alteryx Designer Desktop Discussions

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

overwrite input file

ayush_mishra
8 - Asteroid

I am reading three files to combine and the output of today's will be used as the input next day. so when reading this output as the input next day, can I keep same name for the input and output? Idea is to read a file name "ABC" as the input and then combining it with other file output as the file name "ABC".

9 REPLIES 9
adityansnair
6 - Meteoroid

Hi Ayush,

 

It would display an error, as the file is being used by two processes at the same time.

Instead, you could add a suffix to your output file using  "Take File/Table Name from Field" and read (e.g. abc*.csv to input all file with the same prefix and file format). But, that would make it more complex

 

atcodedog05
22 - Nova
22 - Nova

Hi @ayush_mishra 

 

Here is what you can do. 

Configure Input tool to get the full path

atcodedog05_1-1606196227441.png

It pulls in full path, filename and sheetname

atcodedog05_5-1606196413791.png

And in output tool configure it to change path based on filename.

atcodedog05_3-1606196290733.png

Make sure output option is overwrite.

atcodedog05_4-1606196353003.png

Hope this helps 🙂 Feel to ask if you have any questions


If this post helps you please mark it as solution. And give a like if you dont mind 😀👍

Per
11 - Bolide

Hi @ayush_mishra 

 

I assume you are talking Excel files? Otherwise, I believe this will work for other file types as well:

 

You can use the Block Until Done tool, which will ensure that the input is all read and the file closed before outputting the new data to the same file. This will ensure that the Input and Output tools do not conflict. Please see the example below

 

Per_0-1606232045926.png

 

adityansnair
6 - Meteoroid

Wow @Per this is awesome. Thanks!!!

ayush_mishra
8 - Asteroid

Hi @atcodedog05

 

I played with your file and it worked pretty well but not sure why it didn't work on the actual data that I am working on. I am receiving error - "You must specify a file name".

 

Thanks

ayush_mishra
8 - Asteroid

Hi @Per,

 

It worked but I am getting an error message (enclosed) that file is corrupted although I am able to access file. Is it ok?

 

Thanks

atcodedog05
22 - Nova
22 - Nova

Hi @ayush_mishra 

 

Just specify a temp file name in output tool.

atcodedog05_0-1606328014661.png

Since output need to have a filename configured. Even though it wont be used.

 

Per
11 - Bolide

Hi @ayush_mishra,

 

If possible, copy contents (not formatting) of the file to an entirely new file, and try and run it again. I would not trust a corrupted file, even if you are able to open it now.

ayush_mishra
8 - Asteroid

Hi @atcodedog05. thanks for your response.

 

I think, I understand what is the issue here. I am joining Two files. I am not reading File Path from Left input but Right input. And when I join and create Union, File Name column has two values NULL and File path from Right input. Probably this is causing the issue when I am doing Output. Alteryx might be getting confused seeing NULL value as Path. How do I solve this?

Labels