# Opening a Custom Text File

Learn how to open and handle custom text files in Spread.NET with ease using our comprehensive guide.

## Content

You can open existing text files that are delimited, either files saved from Spread or delimited text files from other sources. The data from the file you open is placed in the sheet for which you call the method.
If the file uses custom delimiters (such as commas in csv files), you must specify the delimiters so Opening a Custom Text Filethe component can correctly place the data within the sheet. If your file uses standard tab-delimited format, you need not use a method that lets you specify delimiters.

> !type=note
> **Note:** If you upgraded from a version prior to version 5, then you may wish to replace any obsolete parameters in the **LoadTextFile** methods.

For more details and current parameters, refer to the [LoadTextFile](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.SheetView.LoadTextFile.html) or [LoadTextFileRange](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.SheetView.LoadTextFileRange.html) methods in the [SheetView](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.SheetView.html) class.
For instructions for saving to text files, see [Saving to a Text File](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-usefiles/spwin-savefiles/spwin-save-texttfile).

## Using Code

Use any of the [LoadTextFile](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.SheetView.LoadTextFile.html) methods in the [SheetView](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.SheetView.html) class (for the **ActiveSheet** or **Sheets** object).

## Example

This example opens a text file and handles the headers and specifies the delimiters.

```csharp
fpSpread1.ActiveSheet.LoadTextFile("C:\\textfile.txt", FarPoint.Win.Spread.TextFileFlags.Unformatted, FarPoint.Win.Spread.Model.IncludeHeaders.BothCustomOnly, "\n", ",", "");
```

```vbnet
fpSpread1.ActiveSheet.LoadTextFile("C:\textfile.txt", FarPoint.Win.Spread.TextFileFlags.Unformatted, FarPoint.Win.Spread.Model.IncludeHeaders.BothCustomOnly, Chr(10), ",", "")
```

## Using the Spread Designer

1. From the **File** menu, select **Open**.
2. A dialog appears warning you that this overwrites your existing settings if you open a file. Click **Yes** to continue with the file open.
    The **Open** dialog appears.
3. Change the **Files of** type box to Custom text files (\*.txt).
    To open a comma-delimited file, change the **Files of** type box to Comma-delimited files (\*.csv).
4. Specify the path and file name of the file to open, and then click **Open**.
    If the file is opened successfully, a message appears stating the file has been opened.
5. Click **OK** to close the Spread Designer.

## See Also

[Opening an XML Data File](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-usefiles/spwin-openfiles/spwin-open-spreadxmldatafile)
[Opening an Excel File](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-usefiles/spwin-openfiles/spwin-open-excelfile)
[Opening a Spread COM File](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-usefiles/spwin-openfiles/spwin-open-spreadcom)