Link Search Menu Expand Document

SSpread.ExportRangeToTextFile Method

Explanation Exports a specific range of cells to a text file using your own specified delimiters.

A cell range specification has been added to the functionality of the exportToTextFile method.

Use ExportRangeToTextFileU so that the output to be a Unicode text file.
Call format ExportRangeToTextFile(col, row, col2, row2, Writer, celldelim, coldelim, rowdelim, flags)
Return value None
Arguments col Start column number of cell range to export
row Start row number of cell range to export
col2 Last column number of cell range to export
row2 Last row number of cell range to export
Writer Export destination Writer Object
celldelim Cell delimiter character
coldelim Column delimiter character
rowdelim Row delimiter character
flags Method to create a file
Specify a combination of the following values.
Constant Value Description
$ExportRangeToTextFileUnformattedData 4 Export as unformatted data
$ExportRangeToTextFileColHeaders 8 Export column header string
$ExportRangeToTextFileRowHeaders 16 Export line header string
$ExportRangeToTextFileAllHeaders 24 Export all header strings
$ExportRangeToTextFileCheckBoxFalse 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 ExportRangeToTextFile method
Example of use
    var fs = new FileSystem();
    var f = fs.SaveDialog("Save", "Text File(*.txt)=*.txt", "txt", "");
    ExportRangeToTextFile(1, 1, 10, 10, f, "", ",", "", $ExportToTextFileAllHeaders);
    f.Close();
    
Related item ExportRangeToTextFileU, exportToTextFile, LoadTextFile methods