# ReadAllLines(string)

> Reads all lines from a file, resolving logical paths automatically.

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor](/engine/6000.6/script-reference/unityeditor.md)
* **Assembly:** UnityEditor.CoreModule

```csharp
public static string[] ReadAllLines(string path)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): Path to the file. Accepts logical and physical paths.

### Returns

| Type                                                               | Description                                                                   |
| ------------------------------------------------------------------ | ----------------------------------------------------------------------------- |
| [string\[\]](https://learn.microsoft.com/dotnet/api/system.string) | An array containing one element per line. Lines are split on `\r\n` and `\n`. |

### Remarks

Reads the entire file at `path` and returns its lines as a string array. Unlike `File.ReadAllLines`, this method accepts logical paths directly without first converting them with [FileUtil.PathToAbsolutePath](/engine/6000.6/script-reference/unityeditor/fileutil/pathtoabsolutepath.md).

Throws ArgumentException when `path` is null or empty.

Additional Resources: [FileUtil.ReadAllText](/engine/6000.6/script-reference/unityeditor/fileutil/readalltext.md), [FileUtil.ReadAllBytes](/engine/6000.6/script-reference/unityeditor/fileutil/readallbytes.md), [FileUtil.OpenRead](/engine/6000.6/script-reference/unityeditor/fileutil/openread.md)

### Examples

```csharp
using UnityEditor;
using UnityEngine;

public class ReadAllLinesExample
{
    [MenuItem("Example/Read File Lines")]
    static void ReadFileLines()
    {
        string[] lines = FileUtil.ReadAllLines("Packages/com.example.package/Resources/manifest.txt");
        foreach (string line in lines)
            Debug.Log(line);
    }
}
```
