MCPcopy Create free account
hub / github.com/cogentcore/core / OpenCSV

Function OpenCSV

tensor/io.go:37–45  ·  view source on GitHub ↗

OpenCSV reads a tensor from a comma-separated-values (CSV) file (where comma = any delimiter, specified in the delim arg), using the Go standard encoding/csv reader conforming to the official CSV standard. Reads all values and assigns as many as fit.

(tsr Tensor, filename core.Filename, delim rune)

Source from the content-addressed store, hash-verified

35// to the official CSV standard.
36// Reads all values and assigns as many as fit.
37func OpenCSV(tsr Tensor, filename core.Filename, delim rune) error {
38 fp, err := os.Open(string(filename))
39 defer fp.Close()
40 if err != nil {
41 log.Println(err)
42 return err
43 }
44 return ReadCSV(tsr, fp, delim)
45}
46
47//////////////////////////////////////////////////////////////////////////
48// WriteCSV

Callers

nothing calls this directly

Calls 4

ReadCSVFunction · 0.85
PrintlnMethod · 0.80
OpenMethod · 0.65
CloseMethod · 0.65

Tested by

no test coverage detected