# View contents of ROOT file like a csv viewer

**URL:** <https://root-forum.cern.ch/t/view-contents-of-root-file-like-a-csv-viewer/51604>\
**Category:** Newbie\
**Created:** [September 18, 2022, 7:27pm UTC](https://root-forum.cern.ch/t/view-contents-of-root-file-like-a-csv-viewer/51604 "2022-09-18T19:27:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yannis\_Kingdom](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/yannis_kingdom/32/30244_2.png) [@Yannis\_Kingdom](https://root-forum.cern.ch/u/Yannis_Kingdom)\
**Post date:** [September 18, 2022, 7:27pm UTC](https://root-forum.cern.ch/t/view-contents-of-root-file-like-a-csv-viewer/51604/1 "2022-09-18T19:27:20Z")

</div>

Hello

Is there a way to view data in a ROOT file in the same way that Jupyter lab shows the contents of a csv file? There doesn’t seem to be any way at the moment - this would be a really helpful addition. Thank you!

Yannis

* * *

_Please read [tips for efficient and successful posting](https://root-forum.cern.ch/t/tips-for-efficient-and-successful-posting/28292) and [posting code](https://root-forum.cern.ch/t/posting-code-read-this-first/28293)_

_ROOT Version:_ Not Provided  
_Platform:_ Not Provided  
_Compiler:_ Not Provided

* * *

---

<div class="post-metadata">

**Author:** ![hvsouza](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/hvsouza/32/23711_2.png) [@hvsouza](https://root-forum.cern.ch/u/hvsouza)\
**Post date:** [September 18, 2022, 11:55pm UTC](https://root-forum.cern.ch/t/view-contents-of-root-file-like-a-csv-viewer/51604/2 "2022-09-18T23:55:26Z")

</div>

Hi Yannis,

Please specify what type of data you have in your root file. It can be a TTree, a histogram or Canvas. You can even make available the file here I believe.

In any case, after opening a file using:

```auto
root my_file_name.root

```

You can always use TBrowser to quickly inspect files and plot things:

```auto
new TBrowser

```

Or you can check the content using

```auto
.ls

```

If it is a TTree (named “mytree”), you can use

```auto
mytree->Print()

```

to check all branches sizes, types, etc. If you want to scan a branch named “coordinates” and another one named “time”, you can do it by:

```auto
mytree->Scan("coordinates:time")

```

For scanning all branches use Scan(“\*”).

Hope that helps.

Cheers

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [September 19, 2022, 6:08am UTC](https://root-forum.cern.ch/t/view-contents-of-root-file-like-a-csv-viewer/51604/3 "2022-09-19T06:08:48Z")

</div>

You can also see/manipulate the content of ROOT’s files using the [command line tools](https://root.cern/manual/root_files/#root-command-line-tools).

---

<div class="post-metadata">

**Author:** ![Yannis\_Kingdom](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/yannis_kingdom/32/30244_2.png) [@Yannis\_Kingdom](https://root-forum.cern.ch/u/Yannis_Kingdom)\
**Post date:** [September 19, 2022, 12:59pm UTC](https://root-forum.cern.ch/t/view-contents-of-root-file-like-a-csv-viewer/51604/4 "2022-09-19T12:59:27Z")

</div>

Thank you both for your replies. I am aware of these solutions, I was thinking about this more from the perspective of a non-coder who would like to view the contents of the file in an eye-pleasing way. I was thinking something along the lines of different csv viewer tools in VS Code and Jupyter Lab (see for example [https://user-images.githubusercontent.com/44871521/86041615-85f25000-ba63-11ea-97e4-45f76f33138d.png](https://user-images.githubusercontent.com/44871521/86041615-85f25000-ba63-11ea-97e4-45f76f33138d.png)), where different vectors inside the ROOT file are presented in a similar way. I guess this does not quite exist at the moment, but it would be a nice addition, I think.

Thanks again for your help - and have a great day!

Cheers

---

<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:** [September 23, 2022, 7:00am UTC](https://root-forum.cern.ch/t/view-contents-of-root-file-like-a-csv-viewer/51604/5 "2022-09-23T07:00:15Z")

</div>

Not the same, but also interesting: [TBrowser alternative for non-X11 mode - #19 by couet](https://root-forum.cern.ch/t/tbrowser-alternative-for-non-x11-mode/20754/19)  
and: [[gui] Variable Explorer GUI class · Issue #11295 · root-project/root · GitHub](https://github.com/root-project/root/issues/11295)  
and: [Converting root file to csv using root2csv](https://root-forum.cern.ch/t/converting-root-file-to-csv-using-root2csv/42583)
