How to read files and display calculated value in the graph

Hi all,
I am new in the root program. I am facing some problems. Please help me by giving some suggestion. I have listed my problems in the following,

1.how to read data files one by one
2.how to display a calculated value of each data file in its corresponding graph? I tried with Tlegend but it can only display the line of the graph not any calculated value. Then tried with TPevtex and it also fails.

Hi,

  1. What is exactly a data file? A root file? a csv file? Some other format?
  2. Drawing a graph is not linked to its legend. Can you post the minimal example which shows what is not working?

Cheers,
D

hello,

The data file is .Spe file and .txt file. There are many file in the folder but i want to read only all .Spe file or .txt file from the the folder. Please suggest me how i will do that.

Thanks in advance.

Very likely the .txt files are ascii files. But what are the .spe files ? can you post one of them and we can try to show you how to produce a TGraph from it.

.spe file nothing but a text file. It is the output file of a mca(multi channel analyser). it can be easily converted to .txt file.

can you post one of them and we can try to show you how to produce a TGraph from it ?