# File type

**URL:** <https://forum.uipath.com/t/file-type/11490>\
**Category:** Help\
**Tags:** studio, system, activities\
**Created:** [September 11, 2017, 2:24pm UTC](https://forum.uipath.com/t/file-type/11490 "2017-09-11T14:24:12Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![sowmya](https://avatars.discourse-cdn.com/v4/letter/s/a5b964/32.png) [@sowmya](https://forum.uipath.com/u/sowmya)\
**Post date:** [September 11, 2017, 2:24pm UTC](https://forum.uipath.com/t/file-type/11490/1 "2017-09-11T14:24:12Z")

</div>

i want to open a file which is in type : “file” and it presents is in some given folder path  
and i want to open that file in notepad how to do this?

---

<div class="post-metadata">

**Author:** ![ClaytonM](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/claytonm/32/555957_2.png) [@ClaytonM](https://forum.uipath.com/u/ClaytonM)\
**Post date:** [September 11, 2017, 2:35pm UTC](https://forum.uipath.com/t/file-type/11490/2 "2017-09-11T14:35:23Z")

</div>

Hi @sowmya  
I would suggest looking at either the **Open Application** or **Start Process** activities. Use the path to notepad for the application or process (which I believe is in your Windows folder). Then, for arguments use the full path to the file you want to open. (If you do this in Start Process you need the argument surrounded by quotes to work)

---

<div class="post-metadata">

**Author:** ![sowmya](https://avatars.discourse-cdn.com/v4/letter/s/a5b964/32.png) [@sowmya](https://forum.uipath.com/u/sowmya)\
**Post date:** [September 11, 2017, 2:44pm UTC](https://forum.uipath.com/t/file-type/11490/3 "2017-09-11T14:44:28Z")

</div>

i have tried this one but i want to open a file which is in format/type: "file "  
i want to open that file in notepad how to do this

example:myfile is in file format  
if want to open this file in notepad rightclick-\>openwith-\>notepad

Using startprocess activity  
i am able to open the **folder** but not able to open a file in notepad

---

<div class="post-metadata">

**Author:** ![ClaytonM](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/claytonm/32/555957_2.png) [@ClaytonM](https://forum.uipath.com/u/ClaytonM)\
**Post date:** [September 11, 2017, 2:57pm UTC](https://forum.uipath.com/t/file-type/11490/4 "2017-09-11T14:57:35Z")

</div>

so assuming the filename is something like this  
“filename.file”

In Start Process, use the path to notepad for process like  
“C:\Windows\notepad.exe”

Then, for Argument use the filepath like  
“”“”+directory+“\filename.file”“”

The extra quotes are needed because you need quotes if there are spaces. It’s similar to commandline scripting.

The alternative to this is the Open Application activity which may be more user friendly, and fill out the application and argument similarly.

Hope this explains it better.  
Thanks.

---

<div class="post-metadata">

**Author:** ![Lucas.Pimenta](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/lucas.pimenta/32/170092_2.png) [@Lucas.Pimenta](https://forum.uipath.com/u/Lucas.Pimenta)\
**Post date:** [September 11, 2017, 2:58pm UTC](https://forum.uipath.com/t/file-type/11490/5 "2017-09-11T14:58:34Z")

</div>

Hello!

There are two ways to do this:

1. You just have to move your file and rename with a .txt extension. Then open it with Open application (Notepad)

2. Use the following code: _System.Diagnostics.Process.Start(“Notepad.Exe”, documentPath)_

**Here’s a xaml example of the second way:** [openFileExtension\_NotepadExample.xaml](https://global.discourse-cdn.com/uipath/original/2X/5/53799ed3eb1438a9fb61ab47e3ca92e57eaef250.xaml) (6.9 KB)

Hope It Helps!!

Regards,

---

<div class="post-metadata">

**Author:** ![sowmya](https://avatars.discourse-cdn.com/v4/letter/s/a5b964/32.png) [@sowmya](https://forum.uipath.com/u/sowmya)\
**Post date:** [September 12, 2017, 6:19am UTC](https://forum.uipath.com/t/file-type/11490/6 "2017-09-12T06:19:15Z")

</div>

Getting error cannot find filename.file

---

<div class="post-metadata">

**Author:** ![sowmya](https://avatars.discourse-cdn.com/v4/letter/s/a5b964/32.png) [@sowmya](https://forum.uipath.com/u/sowmya)\
**Post date:** [September 12, 2017, 6:48am UTC](https://forum.uipath.com/t/file-type/11490/7 "2017-09-12T06:48:39Z")

</div>

Thank you now its working after removing .file

---

<div class="post-metadata">

**Author:** ![sowmya](https://avatars.discourse-cdn.com/v4/letter/s/a5b964/32.png) [@sowmya](https://forum.uipath.com/u/sowmya)\
**Post date:** [September 12, 2017, 7:01am UTC](https://forum.uipath.com/t/file-type/11490/8 "2017-09-12T07:01:43Z")

</div>

After opening the file i want to edit the file in particular line how to do this

---

<div class="post-metadata">

**Author:** ![ClaytonM](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/claytonm/32/555957_2.png) [@ClaytonM](https://forum.uipath.com/u/ClaytonM)\
**Post date:** [September 12, 2017, 2:12pm UTC](https://forum.uipath.com/t/file-type/11490/9 "2017-09-12T14:12:19Z")

</div>

Hi @sowmya  
I would suggest (instead of opening the file) use **Read Text File**. So don’t even open it in Notepad. Read Text File will store all the text into a variable.

Then, after you Read the text you can edit and manipulate the string.

For example, if strText is the text you stored from Read Text File and lineIndex is the line you want to edit.  
**strText.Replace(strText.Split(vblf(0))(lineIndex),“stringlinetoReplacewith”)**

There’s much you can do with this. You could google on all the various string manipulations for other suggestions.

After you have edited your text, then use Write Text File to overwrite the file.

Thanks.

EDIT: Also, you can use LINQ or ForEach to loop through lines if you want the line that you edit more dynamic, for example looking for key words. Anyway hope this info is helpful.
