Link Search Menu Expand Document

SSpread.LoadTextFile Method

Explanation Read a text file.

the data delimiter can be specified in the text file. The column delimiter is used to split the column. The row delimiter is used to split the row. The default value is the line feed code. The cell delimiter is a character that is considered to be added to the left and right of the cell data when the character specified as the delimiter is included in the data. The default value is double quotes (").

The LoadTabFile method can be used to load a simple tab-delimited file.
Call format LoadTextFile(URL or Reader, celldelim, coldelim, rowdelim, flags)
Return value None
Arguments URL or Reader Tab-delimited file URL or Reader Object

The file will be cached on local computer for faster loading from the next time onwards if URL is specified. The latest files can be acquired from the server by specifying an HttpResponse object.
celldelim A string representing the cell delimiter
coldelim A string representing the column delimiter
rowdelim A string representing the row delimiter
flags Method to read the file
Specify a combination of the following values.
Constant Value Description
$LoadTextFileNoHeaders 0 Do not set the header value
$LoadTextFileColHeaders 1 Set the first line of the text file to the value of the column header
$LoadTextFileRowHeaders 2 Set the first column of the text file to the row header value
$LoadTextFileClearDataOnly 4 Erases all existing data when reading a text file and keeps only the format setting
Exception EXT-24 No valid Reader object specified
EXT-28 An error occurred in the LoadTextFile method
Example of use
    var session = findHttpSession("http://example.com");
    var res = session.Get("textfile.txt");
    LoadTextFile(res, "", ",", "", $LoadTextFileNoHeaders);
    
Related item ExportRangeToTextFile, ExportToTextFile, LoadFromFile, LoadTabFile methods
HttpResponse class