ops

package
v0.0.0-...-737f61f Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2017 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StripNewlines

func StripNewlines(l *Line) error

StripNewlines removes any newlines in a record

Types

type Line

type Line struct {
	LineNo int
	Record []string
}

Line represents a line we read from a csv file

func NewLine

func NewLine(lineNo int, record []string) *Line

NewLine creates a Line structure

type Mutator

type Mutator func(l *Line) error

Mutator is a function that knows how to mutate a Line

func CheckWithdrawal

func CheckWithdrawal(i int) Mutator

CheckWithdrawal converts an entry like 'Check Withdrawal: #999999' to '(#999999)'

func DeparenNegatives

func DeparenNegatives(i int) Mutator

func EnsureDollars

func EnsureDollars(i int) Mutator

func MoveAndNegateIfPresent

func MoveAndNegateIfPresent(from int, to int) Mutator

func Negate

func Negate(i int) Mutator

func RemoveText

func RemoveText(i int, rem string) Mutator

RemoveText removes the substring rem, if it is present, up to one time.

func ReplaceHeader

func ReplaceHeader(header []string) Mutator

ReplaceHeader changes the first line

func StripCommas

func StripCommas(i int) Mutator

func StripSuffix

func StripSuffix(i int, suffix string) Mutator

Jump to

Keyboard shortcuts

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