libfort
libfort copied to clipboard
Feature request: raw CSV output
In my application, I pretty-print the data, but save them in a CSV as well. This would relieve me from having to manually write to the CSV stream myself (though the C++ syntax is similar).
Hi! I'll also add that there were some requests to add output in the format that can be used in HTML.
Same here! The CSV output would be amazing!
Depending on the data in your cells, you can format cells to semi-automate csv output using libfort. For example, if you set FT_CPROP_RIGHT_PADDING and FT_CPROP_LEFT_PADDING to 0 with FT_PLAIN_STYLE, then you can write out commas into the cells when adding values. For example, I have a table of doubles I print with:
ft_printf_ln(table, "%8.2lf,|%8.2lf,|%8.2lf,|%8.2lf", vals[0], vals[1], vals[2], vals[3]);
which results in:
-1.12, 0.00, 0.00, 4.12
Using that, you can create your own csv outputter with relative ease.