## XSIUtils.ReadTextFile

### Introduced

v9.0 (2011)

### Description

Reads an ASCII or unicode text file into a string, using the same logic that is used in the Softimage script editor to appropriately detect and read the file type.

### C# Syntax

    String XSIUtils.ReadTextFile( String in_Path );

### Scripting Syntax

    oString = XSIUtils.ReadTextFile( in_path );

### Return Value

The content of the file as a String, potentially containing unicode characters

### Parameters

Parameter | Type | Description
--- | --- | ---
in_path | String | Path to the existing text file.

### Examples

#### JScript Example

    var file_path = XSIUtils.BuildPath( XSIUtils.Environment("XSI_USERHOME"), "MyTextTestFile.txt" );

    var test_text = "Hello, world!";

    try

    {

    	XSIUtils.WriteUTF16TextFile( file_path, test_text );

    	Application.LogMessage( XSIUtils.ReadTextFile( file_path ) );

    }

    catch (e)

    {

    }

### See Also

XSIUtils.WriteUTF16TextFile XSIUtils.Environment