For Each File Overwrite First File Result

Hello all

I tried to create a program which reads a list of files on a folder and runs the loop for each of the files (basically excel A into result A, B into result B, and so on). The program runs fine when there is only one file in the folder. But when I added two files (A and B) into the folder, the program only returns with one result only. What made it weirder is that the result is named as result A but the content is B.

From what I observed, the program runs smoothly, but when it gets to run the second file, it just overwrites the result into result A with its own content. How do I make it properly so that file A will be saved as result A, file B into result B, and so on?

Thanks

Image:


Hi @rookies,

As per my understanding you are using write range activity while you need to use append range activity or you can use a counter which will increase for every file and will create a new excel according.
There are multiple ways to do that other than what I have told you.

Best!!
Anmol

Hi. Thank you for your response.

After further tweak, I found out that I accidentally declare the same variable twice and pass it as the name files. So when it goes on loop, I assume the program read what available on variable 1 while it stored in the other variable that didn’t get read.

Begginer’s mistake

1 Like

@rookies - No problem.

Close this thread then.

Happy learning.:slightly_smiling_face:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.