Functions > Reading and Writing Files > About Functions for Reading and Writing Files
  
About Functions for Reading and Writing Files
The following functions are useful for reading various file types into PTC Mathcad arrays. Descriptions are grouped by file type.
Data Files
READFILE, WRITEFILE—Reads or writes an array of values from/to delimited, fixed width, or Excel data files.
READTEXT, WRITETEXT—Reads or writes an array of values from/to text files.
READBIN, WRITEBIN—Reads or writes an array of values from/to binary data files.
READCSV, WRITECSV—Reads or writes an array of values from/to comma separated variable (CSV) data files.
READPRN, WRITEPRN, APPENDPRN—Reads, writes or appends an array of values from/to ASCII data files.
READEXCEL, WRITEEXCEL—Reads and writes an array of values from/to Microsoft Excel files.
Image Files
READ_IMAGE—Reads grayscale images.
READBMP, WRITEBMP—Reads or writes grayscale bitmap images.
READRGB, WRITERGB—Reads or writes RGB images stored as simple packed matrices.
Image Properties
READ_RED, READ_GREEN, READ_BLUE—Reads specific color components from image files.
READ_HLS, WRITE_HLS—Reads or writes an array of values from/to HLS image files.
READ_HSV, WRITE_HSV—Reads or writes an array of values from/to HSV image files.
READ_HLS_SAT, READ_HSV_SAT, READ_LIGHT, READ_VALUE, READ_HUE—Reads the saturation, light, value, or hue component from HLS or HSV image files.
Sound Files
READWAV, WRITEWAV—Reads and writes arrays containing signal amplitudes in WAV files.
GETWAVINFO—Creates a vector containing information about a WAV file.
Additional Information
When you define a file name as an argument to one of the file access functions, you must include the file type. For example, a valid filename is “monalisa.bmp”.
Pathnames are relative to the current working directory. To verify the current working directory, type the command CWD=.
In all write functions, both rows and cols arguments are indices that start with 1. ORIGIN does not affect the behavior of read functions.