# How can I save values to .txt file with RDataFrame?

**URL:** <https://root-forum.cern.ch/t/how-can-i-save-values-to-txt-file-with-rdataframe/51118>\
**Category:** Newbie\
**Created:** [August 9, 2022, 4:49pm UTC](https://root-forum.cern.ch/t/how-can-i-save-values-to-txt-file-with-rdataframe/51118 "2022-08-09T16:49:15Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![ferhue](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ferhue/32/29462_2.png) [@ferhue](https://root-forum.cern.ch/u/ferhue)\
**Post date:** [August 10, 2022, 12:41pm UTC](https://root-forum.cern.ch/t/how-can-i-save-values-to-txt-file-with-rdataframe/51118/11 "2022-08-10T12:41:11Z")

</div>

You can also follow the example of the link above.

namely using the function [Take()](https://root.cern/doc/master/classROOT_1_1RDF_1_1RInterface.html#aa571f08b8e4d9300cacdea039a379a22) or [Foreach()](https://root.cern/doc/master/classROOT_1_1RDF_1_1RInterface.html#ad2822a7ccb8a9afdf3e5b2ea321886ca).

Or you can use [Snapshot()](https://root.cern/doc/master/classROOT_1_1RDF_1_1RInterface.html#ac5903d3acec8c52f13cbd405371f7fb7) to save a TTree, and then [export it as CSV](https://root-forum.cern.ch/t/root-tree-to-csv-file-format/27633/4)

---

_[View the full topic](https://root-forum.cern.ch/t/how-can-i-save-values-to-txt-file-with-rdataframe/51118)._
