Link Search Menu Expand Document

SSpread.ExportToTextFile Method

Explanation Export the spreadsheet to a text file using own specified delimiter.

The data delimiter (delimiter) can be specified in the text file.The column delimiter is used as a column delimiter. If not specified, the data will not be separated. The row delimiter is used as a row delimiter. The default value is the line feed code.
The cell delimiter is added under the following conditions.
- When the data contains the characters specified as the delimiter
- When the data contains double quotes (")
The default value for the cell delimiter is a double quote ("). The cell delimiter is attached to the left and right of the cell data.

Use the ExportRangeToTextFile method to export a specific cell range. Use ExportToTextFileU if want the output to be a Unicode text file..
Call format ExportToTextFile(Writer, celldelim, coldelim, rowdelim, flags)
Return value None
Arguments Writer Export destination Writer Object
celldelim Character string representing the cell delimiter
coldelim A string representing the column delimiter
rowdelim A string representing the line delimiter
flags Method to create a file
Specify a combination of the following values.
Constant Value Description
$ExportToTextFileUnformattedData 4 Export as unformatted data
$ExportToTextFileColHeaders 8 Export column header string
$ExportToTextFileRowHeaders 16 Export line header string
$ExportToTextFileAllHeaders 24 Export all header strings
$ExportToTextFileCheckBoxFalse 32 Checkbox type cells that are not checked output 0
Exception EXT-25 No valid Writer object specified
EXT-28 An error occurred in the ExportToTextFile method
Example of use
    var fs = new FileSystem();
    var f = fs.SaveDialog("Save", "HTML File(*.html)=*.html", "html", "");
    ExportToHTMLEx(f, "XX Table", "http://example.com/sample.css", "ctable", "ctr", "ctd", "cth");
    f.Close();
    
Related item ExportRangeToTextFile, ExportToTextFileU, LoadTextFile method