You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to request two features regarding csv writing.
First, it would be really nice if users can disable printing the column names. In some situations, the whole data is not available and new value of the structure are read and written inside an event loop. But when it's transformed to a string, the output string contains the column names each time. But a correct csv file only has the column names once on the top.
The second request is whether we could output to a csv string from a vector of struct. In most of cases, each row in a csv file represents a data point and it's very normal to have something like std::vector<DataPoint>. So it would be greate to have an API like:
structCsvStruct{
int header1 = 1;
float header2 = 2.;
std::string header3 = "a";
};
automain() -> int {
auto my_csv = std::vector<CsvStruct>{};
my_csv.emplace_back();
auto buffer = std::string{};
auto ec =
glz::write<glz::opts{.format = glz::csv, .layout=glz::rowwise}>(
my_csv, buffer);
return0;
}
Many thanks in advance
The text was updated successfully, but these errors were encountered:
Thanks for your suggestions. I've had an issue for a while about supporting CSVs without column or row keys (#853), so this is extra motivation to get that done.
Your example of std::vector<DataPoint> is also a good suggestion.
I'm not sure when I'll get to these, because I'm making other improvements to Glaze right now. But, I'll keep this issue alive until these features are added.
Hi,
I would like to request two features regarding csv writing.
First, it would be really nice if users can disable printing the column names. In some situations, the whole data is not available and new value of the structure are read and written inside an event loop. But when it's transformed to a string, the output string contains the column names each time. But a correct csv file only has the column names once on the top.
For example:
outputs a string:
which is an ill-formatted csv file.
The second request is whether we could output to a csv string from a vector of struct. In most of cases, each row in a csv file represents a data point and it's very normal to have something like
std::vector<DataPoint>
. So it would be greate to have an API like:Many thanks in advance
The text was updated successfully, but these errors were encountered: