A newer version of Max is available. Click here to access the latest version of this document.


Read and write a single matrix as a formatted text file


The jit.fprint object can import or export a single matrix from or to a text file.

Matrix Operator

matrix inputs:1, matrix outputs:1
Name IOProc Planelink Typelink Dimlink Plane Dim Type
out n/a 1 1 1 1 1 char long float32 float64

Information for Jitter Matrix Operator (MOP) messages and attributes to this object


read filename [symbol]
Open and read a single matrix from a text file. The optional argument specifies the filename. The jit.fprint object expects text files to be formatted in the same fashion in which it writes them. Attempting to read unformatted text files will likely return an error.
write filename [symbol]
Create a new text file for writing. The optional argument specifies a filename. The text file is not written until a matrix is received by the jit.fprint object. After a write attempt, the message write followed by two int arguments will be sent from the object's right outlet. The first int indicates the success (1) or failure (0) of the write operation, and the second int indicates the number of bytes written to the file (if any).


Name Type g/s Description
default_dir symbol Equivalent to defaultdir.
defaultdir symbol The default directory for writing files (default = default path)
coldelim symbol The column delimiter (default = tab)
planedelim symbol The matrix plane delimiter (default = space)
precision int The number of characters of floating-point precision (default = 6)
rowdelim symbol The row delimiter (default = carriage return)
writemode int Data write mode (default = 0 (integer))
0 = integers used when writing matrix values
1 = floats used when writing matrix values

Information for box attributes common to all objects


See Also

Name Description
jit.print Print a matrix as text in the Max window
jit.textfile Read and write a matrix as an ASCII text file