Module encoding.csv stdlib

encoding.csv
Version:
0.3.3
License:
MIT
Dependencies from vmod:
0
Imports:
2
Imported by:
0
Repository:
OS-specific
Show selected OS-specific symbols.
Backend-specific
Show selected Backend-specific symbols.

Dependencies defined in v.mod

This section is empty.

Imports

Imported by

This section is empty.

Overview

Reader example

import encoding.csv

data := 'x,y\na,b,c\n'
mut parser := csv.new_reader(data)
// read each line
for {
    items := parser.read() or { break }
    println(items)
}

It prints:

['x', 'y']
['a', 'b', 'c']

Aliases

This section is empty.

Constants

This section is empty.

Sum types

This section is empty.

Functions

#fn decode[T]

fn decode[T](data string) []T

decode csv to struct

#fn new_reader

fn new_reader(data string, config ReaderConfig) &Reader

new_reader initializes a Reader with string data to parse and, optionally, a custom delimiter.

#fn new_writer

fn new_writer(config WriterConfig) &Writer

new_writer returns a reference to a Writer

Structs

#struct ReaderConfig

params
pub struct ReaderConfig {
	delimiter u8 = `,`
	comment   u8 = `#`
}

#struct WriterConfig

params
pub struct WriterConfig {
	use_crlf  bool
	delimiter u8 = `,`
}

Interfaces

This section is empty.

Enums

This section is empty.