Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseCSV ¶
func ParseCSV(filepath string, headerRows int, fieldMap *FieldIndexMap) ([]structs.PriceRecord, error)
ParseCSV reads a csv at the given filepath and converts it to pricing records we can examine
Types ¶
type FieldIndexMap ¶
type FieldIndexMap struct { UUID int ProductID int CustomerID int PurchaseDate int DocumentNumber int DocumentLineNumber int Price int }
FieldIndexMap provides a structure which enables readr to find data fields in the csv provided. Seven fields are required to build records, but not all might be present in the data sent to this command. Use a negative value for readr to "build" the field using the row index.
var DefaultFieldMap FieldIndexMap = FieldIndexMap{
UUID: 0,
ProductID: 1,
CustomerID: 2,
PurchaseDate: 3,
DocumentNumber: 4,
DocumentLineNumber: 5,
Price: 6,
}
Click to show internal directories.
Click to hide internal directories.