# How read .txt files

**URL:** <https://discourse.openiap.io/t/how-read-txt-files/792>\
**Category:** OpenRPA\
**Created:** [August 30, 2023, 12:09pm UTC](https://discourse.openiap.io/t/how-read-txt-files/792 "2023-08-30T12:09:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vivek\_Sharma](https://discourse.openiap.io/letter_avatar_proxy/v4/letter/v/ba9def/32.png) [@Vivek\_Sharma](https://discourse.openiap.io/u/Vivek_Sharma)\
**Post date:** [August 30, 2023, 12:09pm UTC](https://discourse.openiap.io/t/how-read-txt-files/792/1 "2023-08-30T12:09:42Z")

</div>

Hi @Allan_Zimmermann .  
Hope you doing well. I encounter an issue in openrpa that how we can read text file in openRPA and store all the text of that file in a variable. I don’t find any activity for it.  
Thanks in advance and waiting for your response

---

<div class="post-metadata">

**Author:** ![Vivek\_Sharma](https://discourse.openiap.io/letter_avatar_proxy/v4/letter/v/ba9def/32.png) [@Vivek\_Sharma](https://discourse.openiap.io/u/Vivek_Sharma)\
**Post date:** [August 30, 2023, 12:28pm UTC](https://discourse.openiap.io/t/how-read-txt-files/792/2 "2023-08-30T12:28:13Z")

</div>

If there is no activity for it . Then we can simply use any code the file . Right

---

<div class="post-metadata">

**Author:** ![Allan\_Zimmermann](https://discourse.openiap.io/user_avatar/discourse.openiap.io/allan_zimmermann/32/12_2.png) [@Allan\_Zimmermann](https://discourse.openiap.io/u/Allan_Zimmermann)\
**Post date:** [August 30, 2023, 2:18pm UTC](https://discourse.openiap.io/t/how-read-txt-files/792/3 "2023-08-30T14:18:10Z")

</div>

use

> **[File.ReadAllText Method (System.IO)](https://learn.microsoft.com/en-us/dotnet/api/system.io.file.readalltext?view=net-7.0)**
>
> Opens a text file, reads all the text in the file into a string, and then closes the file.

---

<div class="post-metadata">

**Author:** ![Vivek\_Sharma](https://discourse.openiap.io/letter_avatar_proxy/v4/letter/v/ba9def/32.png) [@Vivek\_Sharma](https://discourse.openiap.io/u/Vivek_Sharma)\
**Post date:** [August 30, 2023, 2:34pm UTC](https://discourse.openiap.io/t/how-read-txt-files/792/4 "2023-08-30T14:34:10Z")

</div>

Ok Thanks @Allan_Zimmermann

---

<div class="post-metadata">

**Author:** ![system](https://discourse.openiap.io/uploads/default/original/2X/a/a1ca7b164ac9a826839704d9ac82c7b5e6bcf557.png) [@system](https://discourse.openiap.io/u/system)\
**Post date:** [September 5, 2023, 4:47am UTC](https://discourse.openiap.io/t/how-read-txt-files/792/5 "2023-09-05T04:47:58Z")

</div>

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