TGraph

Hi everybody,
I’m new in the forum, and it is only recently that I using root.
I would ask help you,
I have a data file, with more columns and more blocks, for example

1 2 3 4 5
6 7 8 9 1
2 3 4 5 6

1 2 3 4 5
9 8 7 6 5
6 5 4 3 2

1 2 5 7 8
6 5 3 6 7
9 5 4 3 2

More columns and more blocks with more lines.

I have to produce a Graph with for example only the 2nd and 4th column, and only for 2nd block. How can i do it? possibly using command line.

Thank you very much!!! :wink:

Hi,

you can construct a TGraph from an ASCII file: root.cern.ch/doc/master/classTG … 4b6826a434
You will not be able to transparently select a single block among the ones you have. A solution could be to isolate one block per file.

Independently of that, this is a task involving text manipulation. For this kind of tasks Python is easier to use than C++. You might want to consider to use PyROOT.

D