Making histogram from text file

Hello everyone.
I am trying to generate a histogram from my data file but the data files contains a lot colums and I want to read data one by one.

For example:
2 4 5
5 7 0
6 1

And I want to read data and fill the histogram start 2,4,5,5,7 and so on…

I am trying this:

void Plotting(){

TH1F *h = new TH1F(“h”, “histogram”,1000,5.,9.);
ifstream inp; double x;“data.dat”);
for (int i=1; i<=1000; i++) {
inp >> x;

I am afraid that I am only reading the first column. Can someone help me how I can read all values one by one?

data.S001.R001.txt (729 Bytes)
Here is the data file.

It looks like your “data file” contains variable length vectors, so you’d better contact the “author” of this file, who should be able to provide you with an appropriate “parser”.

I am actually generating the data files using a monte carlo program.

So, talk to people familiar with this “monte carlo program” (e.g., your colleagues and/or supervisor).

Okay. Thank you, I will do so.