Who doesn't like dumping data to CSV files? But there is a few pain points unless your data is already a string array or the same data type.
The usual way I end up doing it is formatting data to a string, then concatenating it with a delimiter. Then have to figure out if its a new file and prefix the header string. (Its also annoying open file doesn't return an empty file flag (True if New, or Replaced, or Existing AND empty)).
Then you need to add a new column of data - now there is a problem of keeping format specifier strings and header strings in sync. And then you end up with a stray delimiter so your column headers end up offset from the columns... And your format string breaks if you don't get the format code in the right place. And the data you want to dump increases until you have over 60 columns and its a nightmare maintaining long format and header strings, concatenate strings etc!
It would be nice to format a cluster to a string. Optionally include the header row. For a 1D array could take its name and append the index to it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.