Give solution


The Read Text File activity is failing because the specified file C:\Test\abc.txt does not exist. The workflow stops with a File Not Found error. The workflow file and error screenshot are attached for troubleshooting.

Hi,

First, can you check if the file (c:\test\abc.txt) exists using File Explorer etc.?

Regards,

Hi @Ankola,

First, change the path to C:\Test\abc.txt in Read Text file activity.

Then, make sure that the file exists at this location.

Thanks!

Hi @Ankola,

Verify the file actually exists at C:\Test\abc.txt manually. Also ensure you use \ in your Read Text File activity’s path instead of /.

Add a File Exists check before Read Text File, with proper exception handling (try/catch or REFramework’s exception handling), so it fails gracefully with a clear message.

Cheers!

Hi @Ankola

The issue is straightforward: the Read Text File activity is pointing to C:\Test\abc.txt, but that file is not available at that location.

Please verify that the file exists at C:\Test\abc.txt and that the path is correct. If the file is generated/downloaded during the workflow, make sure that step completes before Read Text File runs.

Also, you can use Path.Combine() or a configurable file path instead of hardcoding the path.

Hello @Ankola,

The standard format used by the Windows operating system to structure file paths is the backslash (\).

Considering that the file abc.txt actually exists at the path C:\Test and that there are permissions to read it, the configuration you need to apply to the Read Text File activity is as follows:

  • Project using C#: File path → "C:\\Test\\abc.txt" ← NOTE: A double backslash is used as a separator.

  • Project using VB.NET: File path → "C:\Test\abc.txt"

Below are some screenshots as examples:

I hope this helps you solve your problem.

Hi @Ankola,

This error simply means UiPath can’t find abc.txt at C:\Test\ when it runs.

You can try the below steps:

  1. Open File Explorer and check that the file is actually present at C:\Test\abc.txt. Even a small typo in the name or extension will cause this error.
  2. In the Read Text File activity, make sure the path uses backslashes \, like "C:\Test\abc.txt" (not /).
  3. If the file is supposed to be created earlier in your workflow (downloaded, generated, etc.), make sure that step finishes before Read Text File runs. This is a very common reason for this error.
  4. As a good practice, use the File Exists activity with "C:\Test\abc.txt" to check whether the file exists, and then use an If activity. If the file exists, use Read Text File in the Then block, and handle the missing-file scenario in the Else block. This way, if the file is missing, you get a clear message instead of the workflow crashing.

Once the file is confirmed at that exact path, it should work fine.

Hi

I agree with Ankit, but I would add another step to the flow, if the file is downloaded or moved to the specific place mentioned.
If downloaded, I would use the ‘Download’ activity if possible and then follow the flow mentioned.

If the file is moved I would add a Do While, to check if the file is moved, if not the wait .5 seconds, check again and then set max iterations to 5 seconds or something like that.

The reason to do that is that the activity ‘File Exist’ or ‘Path Exist’ only check at that exact time it runs, this way you would be able to check multiple times, before continuing.

Hope this helps, I will gladly make an example if you want.

Hi @Ankola
First you can check your file exists in the particular path using pathexists activity

Eg: “C:\Input\sample.txt”

If present then in if condition you can ise the readtext file with the correct filepath