# Refering to a file containing huge data

**URL:** <https://root-forum.cern.ch/t/refering-to-a-file-containing-huge-data/39236>\
**Category:** General Chat\
**Created:** [May 3, 2020, 6:02pm UTC](https://root-forum.cern.ch/t/refering-to-a-file-containing-huge-data/39236 "2020-05-03T18:02:06Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![dastudillo](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/dastudillo/32/17280_2.png) [@dastudillo](https://root-forum.cern.ch/u/dastudillo)\
**Post date:** [May 13, 2020, 8:59am UTC](https://root-forum.cern.ch/t/refering-to-a-file-containing-huge-data/39236/4 "2020-05-13T08:59:09Z")

</div>

If the names are too variable to be expressed with a formula/s that depends on the loop variable/s, then you will probably have to write them by hand. Or maybe you can save a list of the paths/names to a text file and read the names from this file in a loop. You can get an on-the-fly listing of the file contents (but if you will not use all the items in the list, you will need to implement a way to skip the ones you don’t want); read for example here, or search for similar threads:

> [@Loop over all objects in a ROOT file](https://root-forum.cern.ch/t/loop-over-all-objects-in-a-root-file/10807):
>
> After having looked for a hint in the forum, I found this thread [http://root.cern.ch/phpBB3//viewtopic.php?f=3&t=7246&p=30333](http://root.cern.ch/phpBB3//viewtopic.php?f=3&t=7246&p=30333) Here I post my version of the small pyroot function, where you can specify a folder path inside the ROOT file. def GetKeyNames( self, dir = "" ): self.cd(dir) return [key.GetName() for key in gDirectory.GetListOfKeys()] TFile.GetKeyNames = GetKeyNames keyList = f.GetKeyNames(internalPath) print "\nKeys in file:", keyList I post it here, with an explic…

---

_[View the full topic](https://root-forum.cern.ch/t/refering-to-a-file-containing-huge-data/39236)._
