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

Method SaveCSV

tensor/table/io.go:69–80  ·  view source on GitHub ↗

SaveCSV writes a table 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 and data (re

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

Source from the content-addressed store, hash-verified

67// of exactly the same table format and data (recommended).
68// Otherwise, only the data is written.
69func (dt *Table) SaveCSV(filename core.Filename, delim Delims, headers bool) error { //types:add
70 fp, err := os.Create(string(filename))
71 defer fp.Close()
72 if err != nil {
73 log.Println(err)
74 return err
75 }
76 bw := bufio.NewWriter(fp)
77 err = dt.WriteCSV(bw, delim, headers)
78 bw.Flush()
79 return err
80}
81
82// SaveCSV writes a table index view to a comma-separated-values (CSV) file
83// (where comma = any delimiter, specified in the delim arg).

Callers 2

AvgCatFunction · 0.45
AvgByColumnFunction · 0.45

Implementers 1

_cogentcore_org_core_plot_plots_Tableyaegicore/symbols/cogentcore_org-core-

Calls 5

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

Tested by

no test coverage detected