CSVImporter๏ƒ

Inherits: RefCounted < Object

High-level CSV importer with Variant conversion.

Description๏ƒ

CSVImporter parses delimiter-separated text and converts fields to Variants such as Nil, bool, int, float, Color, vectors, arrays, and dictionaries when possible. Parser options can trim fields, skip empty or commented rows, change row-length handling, and customize null and boolean values.

Methods๏ƒ

Array

import(file_path: String, delimiter: String = ",", cast_fields_to_same_type: bool = true, options: Dictionary = {}) static

Array

import_string(string: String, delimiter: String = ",", cast_fields_to_same_type: bool = true, options: Dictionary = {}) static

Array

import_string_with_dialect(string: String, dialect: CSVDialect) static

Array

import_string_with_headers(string: String, delimiter: String = ",", cast_fields_to_same_type: bool = true, options: Dictionary = {}) static

Array

import_with_dialect(file_path: String, dialect: CSVDialect) static

Array

import_with_headers(file_path: String, delimiter: String = ",", cast_fields_to_same_type: bool = true, options: Dictionary = {}) static

Variant

parse_record(record: String, options: Dictionary = {}) static


Method Descriptions๏ƒ

Array import(file_path: String, delimiter: String = ",", cast_fields_to_same_type: bool = true, options: Dictionary = {}) static ๐Ÿ”—

Parses a file into typed row arrays. Supports options keys trim_fields, skip_empty_rows, comment_prefixes, row_length_mode, null_values, true_values, and false_values.


Array import_string(string: String, delimiter: String = ",", cast_fields_to_same_type: bool = true, options: Dictionary = {}) static ๐Ÿ”—

Parses a string into typed row arrays. Supports options keys trim_fields, skip_empty_rows, comment_prefixes, row_length_mode, null_values, true_values, and false_values.


Array import_string_with_dialect(string: String, dialect: CSVDialect) static ๐Ÿ”—

Imports string using dialect.


Array import_string_with_headers(string: String, delimiter: String = ",", cast_fields_to_same_type: bool = true, options: Dictionary = {}) static ๐Ÿ”—

Parses a string into dictionaries using the first row as headers. Supports options keys trim_fields, skip_empty_rows, comment_prefixes, row_length_mode, null_values, true_values, and false_values.


Array import_with_dialect(file_path: String, dialect: CSVDialect) static ๐Ÿ”—

Imports file_path using dialect.


Array import_with_headers(file_path: String, delimiter: String = ",", cast_fields_to_same_type: bool = true, options: Dictionary = {}) static ๐Ÿ”—

Parses a file into dictionaries using the first row as headers. Supports options keys trim_fields, skip_empty_rows, comment_prefixes, row_length_mode, null_values, true_values, and false_values.


Variant parse_record(record: String, options: Dictionary = {}) static ๐Ÿ”—

Converts one field string to a Variant when possible. options may customize null_values, true_values, and false_values.