# Copy several histogram in one root file

**URL:** <https://root-forum.cern.ch/t/copy-several-histogram-in-one-root-file/20113>\
**Category:** ROOT\
**Created:** [October 30, 2015, 3:12pm UTC](https://root-forum.cern.ch/t/copy-several-histogram-in-one-root-file/20113 "2015-10-30T15:12:14Z")\
**Posts on this page:** 1\
**Showing post:** 17

<div class="post-metadata">

**Author:** ![quantatanu](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/quantatanu/32/20730_2.png) [@quantatanu](https://root-forum.cern.ch/u/quantatanu)\
**Post date:** [May 20, 2020, 4:36pm UTC](https://root-forum.cern.ch/t/copy-several-histogram-in-one-root-file/20113/17 "2020-05-20T16:36:52Z")

</div>

A related issue:

if I do:

```auto
rootcp source.root:*pattern* dest.root 

```

It complains:

```auto
WARNING: Same name objects aren't supported: 'some_name_with_pattern' of 'source.root' won't be processed

```

The object `some_name_with_pattern` usually has multiple versions: `;1`, `;2` etc. I would like to copy just the latest version but I don’t want to hardcode the version and would like to use just `*pattern*` while copying.

[Here](https://root-forum.cern.ch/t/rooteventselector-and-multiple-ttree-with-the-same-name/28096/6), @couet said:

_Note: If an object has been written to a file multiple times, rootcp will copy only the latest version of that object._

does that mean, despite the warning, `'source.root' won't be processed`, `dest.root` will still be good?

---

_[View the full topic](https://root-forum.cern.ch/t/copy-several-histogram-in-one-root-file/20113)._
