###User Defined Function###
_FileReadToArray

###Description###
Reads the specified file into a 1D/2D array

###Syntax###
#include <File.au3>
_FileReadToArray ( $sFilePath, ByRef $aArray [, $iFlags = $FRTA_COUNT [, $sDelimiter = ""]] )


###Parameters###
@@ParamTable@@
$sFilePath
	Path and filename of the file to be read.
$aArray
	Array to hold returned data
$iFlags
	[optional] Add multiple values together as required
	$FRTA_NOCOUNT (0) - array is 0-based use <a href="../functions/UBound.htm">UBound()</a> to get size
	$FRTA_COUNT (1) - array count in the first element. (default)
	$FRTA_INTARRAYS (2) - Create "array of arrays" - see remarks
	$FRTA_ENTIRESPLIT (4) - Use entire delimiter string as split point (default each character defines a split point)
$sDelimiter
	[optional]
	Used to further split each line of the file - e.g. reading CSV files into a 2D array
@@End@@

###ReturnValue###
@@ReturnTable@@
Success:	An array holding the file contents.
Failure:	An empty string and sets the @error flag to non-zero.
@error:	1 - Error opening specified file
	2 - Unable to Split the file
	3 - File lines have different numbers of fields (only if $FRTA_INTARRAYS flag not set)
	4 - No delimiters found (only if $FRTA_INTARRAYS flag not set)
@@End@@


###Remarks###
If a delimiter is not specified the function returns a 1D array with each element holding a line of the file - line endings can be any mix of @CR, @LF and @CRLF.

When a delimiter is specified the function tries to further split each line of the file - how this is done depends on the setting of the $FRTA_INTARRAYS flag.  If the flag is not set and each line has the same number of fields split by the delimiter then a 2D array is created, but if this is not the case then @error is set to 3 and no array is returned.  If the $FRTA_INTARRAYS flag is set the function creates a 1D array where each element is a further array holding the fields of the line split on the delimiter - the lines do not need to have the same number of fields.  See example below.


If the delimiter is more than a single character then the $FRTA_ENTIRESPLIT flag setting determines the split method.


###Related###
_FileWriteFromArray


###Example###
@@IncludeExample@@
