Ascii file

I am having problems opening/making a histogram in ROOT using files. I used the code from the tutorial and got it to work about an hour ago. It won’t work now. Here is my code:

[code]void nebasic() {

TString dir = gSystem->UnixPathName(gInterpreter->GetCurrentMacroName());
dir.ReplaceAll(“nebasic.C”,"");
dir.ReplaceAll("/./","/");

TFile *f = new TFile(“basic2.root”,“RECREATE”);
TH1F *h1 = new TH1F(“h1”,“Flux”,100,-4,4);
TTree T = new TTree(“ntuple”,“data from ascii file”);
Long64_t nlines = T->ReadFile(Form("/home/monsoon/Desktop/shar/test.cat",dir.Data()),“flux:x:y”);
printf(" found %lld points\n",nlines);
T->Draw("flux/68
0.0036");
T->Write();
}[/code]

When I try to run this in Root I get this:

[quote]root [3] .x nebasic.C
Error: Missing one of ‘;,}’ expected at or after line 8.
Error: Unexpected end of file (G__fignorestream():3) nebasic.C:14:
Error: Missing closing brace for the block opened around line 1.
Error: Unexpected end of file (G__exec_statement()) nebasic.C:14:
*** Interpreter error recovered ***
[/quote]

How do I fix this?

Try with:
Long64_t nlines = T->ReadFile("/home/monsoon/Desktop/shar/test.cat", “flux:x:y”);
or:
Long64_t nlines = T->ReadFile(dir + “test.cat”, “flux:x:y”);
or:
Long64_t nlines = T->ReadFile(TString::Format("%stest.cat", dir.Data()), “flux:x:y”);

Thank you, that worked. I also fixed a problem in my code that I didn’t catch before. Thank you for your help.