Converting root histogram to text file

I am using below commands to convert my histogram to a text file.

$ root -l modules.root
DefaultDigitizer->cd();
my_detector->cd();
pixelcharge->Print("all"); > pixelcharge.txt

The last line gives me two errors:

root [5] pixelcharge->Print(“all”); > pixelcharge.txt
ROOT_prompt_5:1:28: error: expected expression
pixelcharge->Print(“all”); > pixelcharge.txt

ROOT_prompt_5:1:30: error: use of undeclared identifier ‘pixelcharge’
pixelcharge->Print(“all”); > pixelcharge.txt

I am new to root can you please help me out on this?

Thanks!

In ROOT 6 you need:

.> pixelcharge.txt
pixelcharge->Print("all");
.>