Draw a histogram using two selected lines in a data file

In my data file I have 6 columns. 4th column is “energy” and 5th column is “cellID”.As an example
energy / cellID
3.4 / 1
3.5 / 2
2.1 / 3
4.3 / 1
2.1 / 5

same cellID comes several times. I need to fit a histogram using only these two columns (4 & 5). I need cellID in x axis and energy in Y axis.
Can anybody help me to do this. i don’t know how to extract only these 2 columns from the dat file.
Thank you

See examples in the $ROOTSYS/tutorials reading an ascii file, eg basic.C cernbuild.C.

Replace the filling of a Tree by a histogram.


Thanks Brun.
Sorry for posting in 2 places. Actually first I posted it and then noticed that I’ve posted in a wrong place. So did again.
Sorry for that