mappers

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 6, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildHeaderIndex

func BuildHeaderIndex(headers []string) map[string]int

BuildHeaderIndex returns a lookup map using normalized header labels.

func DetectDelimiter

func DetectDelimiter(content string) rune

DetectDelimiter chooses comma, semicolon, or tab from the header line.

func Field

func Field(record []string, index map[string]int, names ...string) string

Field returns the first matching field from a record by normalized header name.

func HasAnyHeader

func HasAnyHeader(index map[string]int, names ...string) bool

HasAnyHeader reports whether any alias exists in the parsed header.

func IsEmptyRecord

func IsEmptyRecord(record []string) bool

IsEmptyRecord reports whether a CSV record contains only blank fields.

func NormalizeHeader

func NormalizeHeader(header string) string

NormalizeHeader makes bank-export headers comparable across languages.

Types

type Format

type Format string

Format identifies a bank statement import layout.

const (
	FormatAuto    Format = "auto"
	FormatGeneric Format = "generic"
	FormatLHV     Format = "lhv"
	FormatCAMT053 Format = "camt053"
	FormatLHVCAMT Format = "lhv-camt"
)

type ParsedCSV

type ParsedCSV struct {
	Headers []string
	Rows    [][]string
	Index   map[string]int
}

ParsedCSV contains a normalized CSV header and data rows.

func ParseCSV

func ParseCSV(content, label string) (*ParsedCSV, error)

ParseCSV reads delimited CSV content with a header row.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL