Spread Windows Forms 6.0 Product Documentation
LoadTextFile(SheetView,Stream,IncludeHeaders,String,String,String,Encoding,TextFileFlags) Method
See Also  Example Support Options
FarPoint.Win.Spread Assembly > FarPoint.Win.Spread.Model Namespace > SpreadSerializer Class > LoadTextFile Method : LoadTextFile(SheetView,Stream,IncludeHeaders,String,String,String,Encoding,TextFileFlags) Method


sheetView
Sheet into which to load the text data
stream
Stream from which to load text
includeHeaders
Whether headers are handled as data
rowDelimiter
Row delimiter string
columnDelimiter
Column delimiter string
cellDelimiter
Cell delimiter string
encoding
Encoding of the file
flags

Glossary Item Box

Loads the text from a stream with the specified formatting.

Syntax

Visual Basic (Declaration) 
Public Overloads Shared Sub LoadTextFile( _
   ByVal sheetView As SheetView, _
   ByVal stream As Stream, _
   ByVal includeHeaders As IncludeHeaders, _
   ByVal rowDelimiter As String, _
   ByVal columnDelimiter As String, _
   ByVal cellDelimiter As String, _
   ByVal encoding As Encoding, _
   ByVal flags As TextFileFlags _
) 
Visual Basic (Usage)Copy Code
Dim sheetView As SheetView
Dim stream As Stream
Dim includeHeaders As IncludeHeaders
Dim rowDelimiter As String
Dim columnDelimiter As String
Dim cellDelimiter As String
Dim encoding As Encoding
Dim flags As TextFileFlags
 
SpreadSerializer.LoadTextFile(sheetView, stream, includeHeaders, rowDelimiter, columnDelimiter, cellDelimiter, encoding, flags)
C# 
public static void LoadTextFile( 
   SheetView sheetView,
   Stream stream,
   IncludeHeaders includeHeaders,
   string rowDelimiter,
   string columnDelimiter,
   string cellDelimiter,
   Encoding encoding,
   TextFileFlags flags
)

Parameters

sheetView
Sheet into which to load the text data
stream
Stream from which to load text
includeHeaders
Whether headers are handled as data
rowDelimiter
Row delimiter string
columnDelimiter
Column delimiter string
cellDelimiter
Cell delimiter string
encoding
Encoding of the file
flags

Example

This example uses the LoadTextFile method.
C#Copy Code
System.IO.Stream stream;
stream = System.IO.File.Open("D:\\SpreadFiles\\tabbed.txt", System.IO.FileMode.Open);
FarPoint.Win.Spread.Model.SpreadSerializer.LoadTextFile(fpSpread1.ActiveSheet, stream, FarPoint.Win.Spread.Model.IncludeHeaders.None, "\t", ",", "", System.Text.Encoding.ASCII, FarPoint.Win.Spread.TextFileFlags.None);
Visual BasicCopy Code
Dim s As New FarPoint.Win.Spread.Model.SpreadSerializer
Dim stream As System.IO.Stream
stream = System.IO.File.Open("D:\SpreadFiles\tabbed.txt", System.IO.FileMode.Open)
s.LoadTextFile(FpSpread1.ActiveSheet, stream, FarPoint.Win.Spread.Model.IncludeHeaders.None, Chr(9), ",", "", System.Text.Encoding.ASCII, FarPoint.Win.Spread.TextFileFlags.None)

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

© 2002-2012 ComponentOne, a division of GrapeCity. All Rights Reserved.