go-csv-table/README.md

53 lines
895 B
Markdown

# go-csv-table
This module reads a RTF and let you get the information per field or column.
**PLEASE NOTE**: the entire CSV fill be read to the memory at once!
## Example:
To read a field at a time:
```go
gct := GoCSVtable{}
gct.OpenCSV("file.csv")
for {
name, err := gct.Read("Name")
if err != nil {
return err
}
surname, err := gct.Read("Surname")
if err != nil {
return err
}
err := gct.Next()
if err == io.EOF {
// File is over...
break
}
}
```
To read the full row:
```go
gct := GoCSVtable{}
gct.OpenCSV("file.csv")
for {
row, err := gct.ReadRow(gct.Row)
if err != nil {
return err
}
err := gct.Next()
if err == io.EOF {
// File is over...
break
}
}
```