Spread WPF Documentation
Opening and Saving Text Files
Spread WPF Documentation > Developer's Guide > Managing Data > Opening and Saving Text Files

You can load or save text files. You can specify the open or save flags as well as the column, row, and cell delimiters. You can also specify the encoding.

You can use the OpenTextFile method to load text files and the SaveTextFileRange method to save text files.

Using Code

The following example opens a text file.

CS
Copy Code
System.IO.Stream stream;
stream = System.IO.File.Open("c:\\zipfile\\savespreadstream.csv", System.IO.FileMode.Open);
gcSpreadSheet1.Sheets[0].OpenTextFile(stream, GrapeCity.Windows.SpreadSheet.Data.TextFileOpenFlags.None, "\r", ",", "");
VB.NET
Copy Code
Dim stream As System.IO.Stream
stream = System.IO.File.Open("c:\zipfile\savespreadstream.csv", System.IO.FileMode.Open)
GcSpreadSheet1.Sheets(0).OpenTextFile(stream, GrapeCity.Windows.SpreadSheet.Data.TextFileOpenFlags.None, Chr(13), ",", "")
See Also