Input/Output

You may have to read in our write data at some point. The commands below show you how to do this in simple cases. For more complicated ones consult the online help.

1. Read a file

First get some data from a disk file.  You have to make sure you set the full path correctly.

(* on a unix machine. *)
data1 = ReadList["/home/gilfoyle/tmp/Nuke.dat",{Number,Number}];

(* on a windows machine desktop. *)
data1 = ReadList["C:\\Documents and Settings\\ggilfoyl\\Desktop\\Nuke.dat",{Number,Number}];

Make a plot to check.

ListPlot[data1]

2. Write out your results.

To write out your data in columns use the Export command. It’s necessary to have the “.dat” extension on the filename.

Export["/home/gilfoyle/tmp/test.dat",data1]