# Issue of saving txt file

**URL:** <https://community.freefem.org/t/issue-of-saving-txt-file/2658>\
**Category:** General Discussion\
**Created:** [August 15, 2023, 8:08pm UTC](https://community.freefem.org/t/issue-of-saving-txt-file/2658 "2023-08-15T20:08:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![DongweiYe](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/dongweiye/32/1073_2.png) [@DongweiYe](https://community.freefem.org/u/DongweiYe)\
**Post date:** [August 15, 2023, 8:08pm UTC](https://community.freefem.org/t/issue-of-saving-txt-file/2658/1 "2023-08-15T20:08:13Z")

</div>

Hi,

I am working on a steady NS equation (with low Reynolds number and fixed-point method) and trying to save the nodal result as .txt:

```auto
ofstream uxfile("sample_u_"+j+".txt");
uxfile << u[] << endl;
ofstream uyfile("sample_v_"+j+".txt");
uyfile << v[] << endl;
ofstream pfile("sample_p_"+j+".txt");
pfile << p[] << endl;

```

But it turns out to be that all the u.txt, v.txt and p.txt has exactly the same data despite that I assigned different values to them. Could you help me with it? I attach the code here:  
[try.edp](https://community.freefem.org/uploads/short-url/xrSBZZVd1TVI0lT8bXTbYLh0Bit.edp) (2.9 KB)

Thank you!

---

<div class="post-metadata">

**Author:** ![aszaboa](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/aszaboa/32/2918_2.png) [@aszaboa](https://community.freefem.org/u/aszaboa)\
**Post date:** [August 17, 2023, 7:19am UTC](https://community.freefem.org/t/issue-of-saving-txt-file/2658/2 "2023-08-17T07:19:05Z")

</div>

[u,v,p] is a vectorial FE object. I contains all the degrees of freedom. You cannot access it like that. The structure is illustrated by the following:

```auto
[u,v,p] = [1,2,3];
for [i, ui : u[]] cout << "i=" << i << ", u[i]=" << ui << endl;

```
