# Importing 2D large data from text file in root and plotting it, performing pattern recognition on charge cluster formation

**URL:** <https://root-forum.cern.ch/t/importing-2d-large-data-from-text-file-in-root-and-plotting-it-performing-pattern-recognition-on-charge-cluster-formation/34752>\
**Category:** Newbie\
**Created:** [June 21, 2019, 5:40pm UTC](https://root-forum.cern.ch/t/importing-2d-large-data-from-text-file-in-root-and-plotting-it-performing-pattern-recognition-on-charge-cluster-formation/34752 "2019-06-21T17:40:45Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![Dilicus](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/dilicus/32/14338_2.png) [@Dilicus](https://root-forum.cern.ch/u/Dilicus)\
**Post date:** [June 24, 2019, 3:27pm UTC](https://root-forum.cern.ch/t/importing-2d-large-data-from-text-file-in-root-and-plotting-it-performing-pattern-recognition-on-charge-cluster-formation/34752/6 "2019-06-24T15:27:36Z")

</div>

I think the last tow errors are due to a missing `;` in the last line.

and maybe try to add an { before the second for  
and a } after the `hd2->SetBinContent(i,j,z);`

Have a look at the post below for the file question.

> [@Reading files, Output files](https://root-forum.cern.ch/t/reading-files-output-files/34493):
>
> if my Files are ordered from file-000.txt to file-100.mca My files path is “/home/Baja/Downloads/file-000.mca, …” How can modify the attached code to read the files one by one, and also save the output results. and how can i make the output files.txt with the same name, and automatic saves in a folder ! for example if the input file is “/home/Baja/Downloads/InputFolder/file-000.mca, …”, the output will be " “/home/Baja/Downloads/ResultsFolder/file-000.txt …” [BAJA.C](https://root-forum.cern.ch/uploads/default/original/3X/8/5/85da94075079e0015682b98bdcb073a31e441d13.C) (367 Bytes)

---

_[View the full topic](https://root-forum.cern.ch/t/importing-2d-large-data-from-text-file-in-root-and-plotting-it-performing-pattern-recognition-on-charge-cluster-formation/34752)._
