# Saving to a data file

**URL:** <https://root-forum.cern.ch/t/saving-to-a-data-file/35900>\
**Category:** Newbie\
**Created:** [September 6, 2019, 6:30am UTC](https://root-forum.cern.ch/t/saving-to-a-data-file/35900 "2019-09-06T06:30:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jbmagallanes](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/jbmagallanes/32/20291_2.png) [@jbmagallanes](https://root-forum.cern.ch/u/jbmagallanes)\
**Post date:** [September 6, 2019, 6:30am UTC](https://root-forum.cern.ch/t/saving-to-a-data-file/35900/1 "2019-09-06T06:30:53Z")

</div>

hi, what is the code in saving printout data to a data file? for example, i want to save these three batches of printouts:

```auto
 av40->Print();
 av41->Print();
 av46->Print();

```

thanks for your help 🙂

regards,  
jaybee

---

<div class="post-metadata">

**Author:** ![Axel](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/axel/32/11084_2.png) [@Axel](https://root-forum.cern.ch/u/Axel)\
**Post date:** [September 8, 2019, 7:46am UTC](https://root-forum.cern.ch/t/saving-to-a-data-file/35900/2 "2019-09-08T07:46:52Z")

</div>

Hi Jaybee,

You can redirect from the prompt using `.> output.txt`

Or you call `av->SavePrimitive()` and edit the resulting source code.

Cheers, Axel

---

<div class="post-metadata">

**Author:** ![jbmagallanes](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/jbmagallanes/32/20291_2.png) [@jbmagallanes](https://root-forum.cern.ch/u/jbmagallanes)\
**Post date:** [September 9, 2019, 3:13pm UTC](https://root-forum.cern.ch/t/saving-to-a-data-file/35900/3 "2019-09-09T15:13:18Z")

</div>

@axel, gracias 🙂 i will try this 🙂
