libfort icon indicating copy to clipboard operation
libfort copied to clipboard

Feature request: raw CSV output

Open LogicStuff opened this issue 4 years ago • 3 comments

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).

LogicStuff avatar Apr 29 '20 09:04 LogicStuff

Hi! I'll also add that there were some requests to add output in the format that can be used in HTML.

seleznevae avatar Apr 29 '20 16:04 seleznevae

Same here! The CSV output would be amazing!

carpikes avatar Nov 23 '20 17:11 carpikes

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.

brlcad avatar Nov 28 '20 19:11 brlcad