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)
| 86 | // of exactly the same table format and data (recommended). |
| 87 | // Otherwise, only the data is written. |
| 88 | func (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), |