# How to extract output data in .dat format from .root files?

**URL:** <https://root-forum.cern.ch/t/how-to-extract-output-data-in-dat-format-from-root-files/58744>\
**Category:** ROOT\
**Created:** [March 27, 2024, 5:52am UTC](https://root-forum.cern.ch/t/how-to-extract-output-data-in-dat-format-from-root-files/58744 "2024-03-27T05:52:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dipanuta](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/d/49beb7/32.png) [@Dipanuta](https://root-forum.cern.ch/u/Dipanuta)\
**Post date:** [March 27, 2024, 5:52am UTC](https://root-forum.cern.ch/t/how-to-extract-output-data-in-dat-format-from-root-files/58744/1 "2024-03-27T05:52:05Z")

</div>

Hello ,

I am working on a Particle physics simulation and need to plot a Photon Spectrum .  
I need to extract data from the .root file .So I used ROOT browser to open the .root file but was unable to save the data in .dat format in which i can get x axis and y axis values .  
Though I tried to save in ascii format ,in my case it saved as graph.dat file .  
But when I open the graph.dat file it shows empty file .  
Please tell how to convert .root files data to .dat or .txt file in which I will get the data in x axis and y axis .

Thank You

## Geant4 Version:\_PACKAGE\_VERSION “10.4.2” \_Operating System:\_CentOS LINUX _Compiler/Version:_ CPack ,Terminal _CMake Version:_ CPack

---

<div class="post-metadata">

**Author:** ![dastudillo](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/dastudillo/32/17280_2.png) [@dastudillo](https://root-forum.cern.ch/u/dastudillo)\
**Post date:** [March 27, 2024, 7:21am UTC](https://root-forum.cern.ch/t/how-to-extract-output-data-in-dat-format-from-root-files/58744/2 "2024-03-27T07:21:53Z")

</div>

Try seaching this forum. This was recently asked:

> [@Convert root file to txt, csv file](https://root-forum.cern.ch/t/convert-root-file-to-txt-csv-file/58729):
>
> Hi all, I would like to convert the root file to a more intuitive way of storing data, such as txt, csv file format, can anyone solve this problem, thank you very much (Linux, Ubuntu 16.04, ROOT 6.10/02)

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [April 10, 2024, 7:22am UTC](https://root-forum.cern.ch/t/how-to-extract-output-data-in-dat-format-from-root-files/58744/3 "2024-04-10T07:22:33Z")

</div>

Closed on April 10, 2024, 7:22am UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
