DSVReader๏
Inherits: RefCounted < Object
Streaming delimiter-separated value reader.
Description๏
DSVReader reads CSV, TSV, PSV, and other single-character delimiter-separated files one row at a time. It uses the same parser options as DSVImporter without loading the full file into memory.
Methods๏
void |
close() |
get_error() const |
|
get_length() const |
|
get_line() const |
|
get_position() const |
|
is_eof() const |
|
open(file_path: String, delimiter: String = ",", options: Dictionary = {}) |
|
read_row() |
|
Method Descriptions๏
void close() ๐
Closes the current file and resets the reader.
Returns the last error produced by open() or read_row().
Returns the current file length in bytes, or 0 when no file is open.
Returns the current one-based input line number.
Returns the current file byte position, or 0 when no file is open.
Returns true when the file has been fully read and no parsed rows remain.
Error open(file_path: String, delimiter: String = ",", options: Dictionary = {}) ๐
Opens file_path for streaming reads. options supports trim_fields, skip_empty_rows, comment_prefixes, row_length_mode, null_values, true_values, and false_values.
PackedStringArray read_row() ๐
Reads and returns the next parsed row. Returns an empty PackedStringArray at EOF or after a parse error.
Array read_rows(max_rows: int = 0) ๐
Reads up to max_rows rows. If max_rows is 0, reads until EOF.