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()

Error

get_error() const

int

get_length() const

int

get_line() const

int

get_position() const

bool

is_eof() const

Error

open(file_path: String, delimiter: String = ",", options: Dictionary = {})

PackedStringArray

read_row()

Array

read_rows(max_rows: int = 0)


Method Descriptions๏ƒ

void close() ๐Ÿ”—

Closes the current file and resets the reader.


Error get_error() const ๐Ÿ”—

Returns the last error produced by open() or read_row().


int get_length() const ๐Ÿ”—

Returns the current file length in bytes, or 0 when no file is open.


int get_line() const ๐Ÿ”—

Returns the current one-based input line number.


int get_position() const ๐Ÿ”—

Returns the current file byte position, or 0 when no file is open.


bool is_eof() const ๐Ÿ”—

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.