# MX\_CSVDELIM

> [HTML Version](mx_csvdelim.htm)

**xcall MIAMEX, MX\_CSVDELIM, opcode, delim**

MX\_CSVDELIM (MIAMEX 181) allows the CSV delimiter to be set or retrieved. 

**Parameters**

_opcode_  ([Num](num.md))  \[in\]

0 (mxop\_get) to retrieve, 1 to (mxop\_set) set

_delim _ ([String](string.md), 1)  \[in/out\]

the delimiter retrieved (opcode 0) or to be set (opcode 1)

**Comments**

When set, the specified delimiter overrides the one normally used by the WRITECD and INPUT CSV statements.

The setting persists for the remainder of the session, or until changed explicitly by another call to MX\_CSVDELIM.

To restore the default behavior, in which the delimiter is determined by the most prevalent of the four typical delimiter characters—comma, semicolon, colon, and tab—in the first line of the file, set the delim to "" (null).

**Example**

XCALL MIAMEX, MX\_CSVDELIM, 0, OLD'DELIMITER\$        \! retrieve original

XCALL MIAMEX, MX\_CSVDELIM, 1, NEW'DELIMITER\$        \! set new

OPEN #CH, FILE\$, INPUT



XCALL MIAMEX, MX\_CSVDELIM, 1, OLD'DELIMITER\$        \! reset to original delimiter (won't affect this file)



INPUT CSV #CH, VAR1, VAR2, ...                      \! (uses NEW'DELIMITER\$) 

