Exporting Tree Branch into an ASCII file

_ROOT Version: 6.18/04
_Platform: ArchLinux 64-Bit
_Compiler: linuxx8664gcc


I have a question about TTree::Scan() or just Trees/branches in general.

I have a Tree with many entries called “tree”. I would like to save a specific branch to an ascii file. I found the following link to TTreePlayer::Scan() and it recommended I use:

tree->Scan("*"); >tree.log

I am able to print out the branch to the console using:


But when using the advice up above I get the following error:

ROOT_prompt_8:1:19: error: use of undeclared identifier 'tree'
tree->Scan("*"); >tree.log

I would like to export the contents of the branch to an Ascii file so I can more easily edit the data. Is there another way to export the contents of a branch into an Ascii file?

Thank you,


You are looking at the doc of an old ROOT version (version 5)

See the update documentation with the procedure to re-direct the output to a file from the ROOT prompt which is valid for ROOT 6 versions:



1 Like

This worked. Thank you!