# How to ignore certain histograms when merging files with hadd?

**URL:** <https://root-forum.cern.ch/t/how-to-ignore-certain-histograms-when-merging-files-with-hadd/22321>\
**Category:** ROOT\
**Created:** [December 6, 2016, 3:53pm UTC](https://root-forum.cern.ch/t/how-to-ignore-certain-histograms-when-merging-files-with-hadd/22321 "2016-12-06T15:53:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mmuskinj](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/m/a587f6/32.png) [@mmuskinj](https://root-forum.cern.ch/u/mmuskinj)\
**Post date:** [December 6, 2016, 3:53pm UTC](https://root-forum.cern.ch/t/how-to-ignore-certain-histograms-when-merging-files-with-hadd/22321/1 "2016-12-06T15:53:28Z")

</div>

Dear all,

I would like to merge several root files containing histograms. However, I would not like to merge some of the histograms. The structure of the files is schematically presented below.

I would like to merge all the histograms in “folder1”, while ignoring histograms outside “folder1”, which are all the same in all the files.

File  
|\_\_\_ folder1

```auto
~~~~ |__ histogram2
~~~~ |__ histogram3
|__ MetaData_EventCount
|__ cutflow1
|__ cutflow2

Is something like this already possible to do with hadd?

Best,
Miha
```

---

<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:** [December 6, 2016, 4:13pm UTC](https://root-forum.cern.ch/t/how-to-ignore-certain-histograms-when-merging-files-with-hadd/22321/2 "2016-12-06T16:13:40Z")

</div>

May be you can try:

> [@How to Quickly Inspect the Content of a File?](https://root-forum.cern.ch/t/how-to-quickly-inspect-the-content-of-a-file/38086):
>
> Note: The root command line tools were released with ROOT 6.06. ROOT provides command line tools that allow you to quickly inspect and modify the content of ROOT files. They can be divided in two categories: The ones having a behaviour which is compatible with the widely known \*nix tools like ls, rm, mkdir. rootls : list the content of a ROOT file. rootcp : copy objects stored in a file to another file. rootrm : delete objects contained in a file. rootmv : move objects stored in a file …

---

<div class="post-metadata">

**Author:** ![mmuskinj](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/m/a587f6/32.png) [@mmuskinj](https://root-forum.cern.ch/u/mmuskinj)\
**Post date:** [December 6, 2016, 6:20pm UTC](https://root-forum.cern.ch/t/how-to-ignore-certain-histograms-when-merging-files-with-hadd/22321/3 "2016-12-06T18:20:38Z")

</div>

Thanks, rootrm will be particularly useful here to remove some histograms from all but one file.
