Split a root file into two parts

Hello,
I have a question about handling root files.

Is there an easy way to split a root file containing branches into to two files each containing half of the events of the original file ( obviously if the number of events (n) is odd then one file would contain abs(n/2) and the other file would contain abs(n/2)+1 events)
By easy way I mean a way without writing a code that opens the original root file, reads the events and then creates 2 root files. What I have in mind (if this helps) is the reverse think of the command hadd.
I am asking because I have a large root file that my laptop cannot handle. I also think that this would help people that copy/transfer large root files from remote computing centres.

Thanks a lot!
Kostas

Hi Kostas,

no, such utility is unfortunately not available.
We will consider this idea as this is a rather common need. If you’d like to contribute, we will be happy to comment, review and integrate Pull Requests on Github: github.com/root-mirror/root

Cheers,
Danilo

Hi Kostas,

I update this old post with something which was developed within a few months from your request, the root command line tools:
root.cern.ch/how/how-quickly-in … ntent-file

Cheers,
Danilo