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