Histogram filling from a file

Is there an easy way to fill a 1 Dimensional Histogram from a normal file (notepad or something) with the variables seperated by commas or carrage returns?

If there is how does this method change for creating 2 or 3 dimensional Histograms and how must the data be stored.

Thanks.

Use a TNtuple/TNtupleD class, as shown in this short example where basic.dat is a file containing 3 columns of numbers.

void hbasic() {
TNtuple *ntuple = new TNtuple(“ntuple”,“test”,“x:y:z”);
ntuple->ReadFile(“basic.dat”);
ntuple->Draw(“x”);
ntuple->Draw(“y”,“x>1”,“same”);
}

Rene