I need help about file

How to open a folder once and read all txt files in the folder and subfolder, and then put the same specified text in all txt files into the text input box?

Why not store all the text in one file ?

To answer your question, you will need the file component.

With the correct path to each file in the folder (then subfolder)
read the file, after read append the text to your textbox, then read the next file and so on.

But how to open a large number of txt files at one time?

Don't. Open them one at a time, get the contents, then move to the next file.

But I need to do that.

Why do they all need to be open at once?

Because I need to integrate many txt files, so I have to do that

Explain what you mean, what you are trying to achieve...

For example, there is "price" in each TXT file, so I will extract the "price"

Therefore once you have extracted the "price" and stored it to a variable/list in your app, why does the file need to remain open ?

A file is never really "open". You read it, or you write to it, it is only "open" when you perform read/write operations. It sounds to me like you have to sort out your data storage and structure.


This simple app creates 20 text files:

  • 10 text files in a subfolder of the ASD /myFolder/ and
  • 10 text files in the subfolder /myFolder/subfolder1/

and read all of them in one step.

saveRead_20textFiles.aia (3.6 KB)

Here is a sample app where you need to read multiple files, but also need to keep their data separate, by name: