CSVDialect
Inherits: RefCounted < Object
Reusable CSV parsing profile.
Description
CSVDialect stores delimiter, header, casting, and parser option settings for common CSV variants. It can be created from built-in profiles, dictionaries, or inferred from a sample string.
Properties
|
||
|
||
|
||
|
Methods
from_dictionary(data: Dictionary) static |
|
from_profile(name: String) static |
|
import_file(path: String) const |
|
import_string(string: String) const |
|
sniff(sample: String, options: Dictionary = {}) static |
|
to_dictionary() const |
Property Descriptions
If true, imported values are converted to typed values.
The delimiter used to split fields.
If true, the first row is treated as headers.
Dictionary options = {} 🔗
void set_options(value: Dictionary)
Dictionary get_options()
Parser options used by this dialect.
Method Descriptions
CSVDialect from_dictionary(data: Dictionary) static 🔗
Creates a dialect from a dictionary produced by to_dictionary().
CSVDialect from_profile(name: String) static 🔗
Creates a built-in dialect profile. Supported names include csv, rfc4180, tsv, excel, and pipes.
Array import_file(path: String) const 🔗
Imports path using this dialect.
Array import_string(string: String) const 🔗
Imports string using this dialect.
CSVDialect sniff(sample: String, options: Dictionary = {}) static 🔗
Infers a dialect from sample.
Dictionary to_dictionary() const 🔗
Serializes this dialect to a dictionary.