# Write/edit a .TXT and save

**URL:** <https://forum.kirupa.com/t/write-edit-a-txt-and-save/322320>\
**Category:** Uncategorized\
**Created:** [May 18, 2011, 2:04am UTC](https://forum.kirupa.com/t/write-edit-a-txt-and-save/322320 "2011-05-18T02:04:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![celestale](https://avatars.discourse-cdn.com/v4/letter/c/9fc348/32.png) [@celestale](https://forum.kirupa.com/u/celestale)\
**Post date:** [May 18, 2011, 2:04am UTC](https://forum.kirupa.com/t/write-edit-a-txt-and-save/322320/1 "2011-05-18T02:04:41Z")

</div>

Hi, currently I’m using this to save the .TXT in desktop, how do I save the .txt in the same folder of my .fla/.exe/.air?

```auto
var file:File = File.desktopDirectory.resolvePath( "text.TXT" );

```

and i’m using this code to open the .txt and write the .txt with new info, but how do I get the info inside the .txt and print it out in flash component datagrid when the flash application starts? so when the application starts, the user will see all the data in the .txt inside flash component datagrid??

```auto

s = st.text+ "
";
stream.open( file, FileMode.APPEND );
stream.writeUTFBytes( s );
stream.close();

```
