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

Method SaveCSV

tensor/table/io.go:88–99  ·  view source on GitHub ↗

SaveCSV writes a table index view to a comma-separated-values (CSV) file (where comma = any delimiter, specified in the delim arg). If headers = true then generate column headers that capture the type and tensor cell geometry of the columns, enabling full reloading of exactly the same table format a

(filename core.Filename, delim Delims, headers bool)

Source from the content-addressed store, hash-verified

86// of exactly the same table format and data (recommended).
87// Otherwise, only the data is written.
88func (ix *IndexView) SaveCSV(filename core.Filename, delim Delims, headers bool) error { //types:add
89 fp, err := os.Create(string(filename))
90 defer fp.Close()
91 if err != nil {
92 log.Println(err)
93 return err
94 }
95 bw := bufio.NewWriter(fp)
96 err = ix.WriteCSV(bw, delim, headers)
97 bw.Flush()
98 return err
99}
100
101// OpenCSV reads a table from a comma-separated-values (CSV) file
102// (where comma = any delimiter, specified in the delim arg),

Callers

nothing calls this directly

Calls 5

WriteCSVMethod · 0.95
CreateMethod · 0.80
PrintlnMethod · 0.80
CloseMethod · 0.65
FlushMethod · 0.45

Tested by

no test coverage detected