Files

This section describes files that can be manipulated by the OpenMatrix Language.

OML uses .oml files to store scripts and functions as a collection of OML statements. OML can read or write data from/to external files using commands acting on external files.

I/O and File Operations

The OpenMatrix language includes a variety of functions to operate on files.

I/O and File Operations functions can act on pure ASCII files or on binary files. They can also be used to either read or write files.

The following table provides a list of suggested functions that you can use for reading and writing various file types:
File Type Reading Function Writing Function
Binary fread (combined with fopen first) fwrite (combined with fclose afterwards)
ABF (Altair Binary Format) readcae, readmultvectors, readvector createabffile (combined with abfaddata, abfclose, and others)
CAE files from Altair solvers and other vendors readcae, readmultvectors, readvector createh3dfile (combined with writeh3ddata, closeh3dfile and others)
Excel-compatible xlsread xlswrite
Column-delimited dlmread, csvread dlmwrite, csvwrite
HDF5 readhdf5, readhdf5attributes, readhdf5toc writehdf5dataset (along with createhdf5dataset) and the counterpart functions that create groups and attributes
MAT load save
Generic text files or format-specific files fgets, fgetl, fscanf printf