csv

package
v0.0.0-...-4958f1d Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Read

func Read(filePath string, separator rune) ([]string, error)

Read reads a CSV file from the given file path and returns a slice of strings containing the data from the first column of the file.

The separator parameter specifies the delimiter used in the CSV file.
The function returns an error if the file cannot be opened or read. It closes the file after reading it.

func Write

func Write(fileName string, folderName string, decisions []models.WriteStruct) error

Write function takes in a fileName string, a folderName string, and a slice of models.WriteStruct named decisions.

It creates a CSV file in the specified folder with the given file name and writes the data from decisions into the file.
This function uses two helper functions, createFile and generateRow.

Types

This section is empty.

Jump to

Keyboard shortcuts

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