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๏
import(file_path: String, delimiter: String = ",", cast_fields_to_same_type: bool = true, options: Dictionary = {}) static |
|
import_string(string: String, delimiter: String = ",", cast_fields_to_same_type: bool = true, options: Dictionary = {}) static |
|
import_string_with_dialect(string: String, dialect: CSVDialect) static |
|
import_string_with_headers(string: String, delimiter: String = ",", cast_fields_to_same_type: bool = true, options: Dictionary = {}) static |
|
import_with_dialect(file_path: String, dialect: CSVDialect) static |
|
import_with_headers(file_path: String, delimiter: String = ",", cast_fields_to_same_type: bool = true, options: Dictionary = {}) static |
|
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.