ASCII Output

Writing out data to a file in ASCII format.

Felix can write out ASCII format data using the wa command. This command will produce an ASCII format output file from the data that is currently in work. See the listing for the wa command in the Felix Command Language Reference Guide. Also take a look at the file format for ASCII data files in the section File Format for ASCII Data Files in Appendix E. Data Files of the Felix User Guide. . Note that in this case the ASCII data is output in a specific format where the data is listed out in four columns.

If you want to output data in a two column format you could use the put command to write out individual data points to a file. You could use either the gv command (for 1D data) or the mgv command (for 2D data) to get the values of a particular data point. You use the opn command to open a file for output and the cls command to close the file. Once a file is open you use the put command to write data to it. This method is more flexible because you have more control over the format of the output data. For example you might want to output only the real values or just two columns of real and imaginary data. This sort of format control would not be possible with the wa command described above.

As an example the following macro creates an output file with two columns of data. Column one contains the real data points and column two contains the imaginary data points.

c**ascii_out.mac
def outfil myoutfile.txt
opn # &outfil 0
for pnt 1 &datsiz 1
gv &pnt real imag
put &real &imag
nex
cls
pur outfil pnt
ret
end


 
   
    
 Back to FAQ's
      Contact us
 
        www.FelixNMR.com 2007