The following hints may help with this exercise.
For information about File.chooser, see the documentation of the File class
in the Programmer's Reference.
Is a file open for the File referenced by f? Type f.isopen()
Define the chooser to be a read type: f.chooser("r")
Pop up the chooser
f.chooser()
and select data4.dat
Is a file open?
2) Save these data using the Print&FileWindowManager/PrintFile/Ascii menu item into the file temp1.dat . Look at the format of the temp1.dat file. Fix the temp1.dat file so it can be read with plotdata.hoc.
3) The data are in a Matrix. Prove this to yourself by typing m and then m.printf. Save the matrix by opening the file with f.wopen("temp2.dat") and then m.fprint(f). Look at the contents of the file and verify that it can be read with plotdata.hoc.
4) Pick one of the data lines into the clipboard and save it using the NEURONMainMenu/Vector/SaveToFile menu item as temp2.dat . Verify that temp2.dat can be read correctly with the NEURONMainMenu/Vector/RetrieveFromFile. Fix the temp2.dat file so it can be read with plotdata.hoc.