Closed wpbullet closed 6 years ago
That is intended behaviour. A CSV file does not know the concept of a "footer". It is meant to provide the data in a format that can be easily imported into spreadsheets or other tools, and the convention is that it either contains pure data, with 1 single, optional header line.
While there are CSV exporter that provide footer output for CSV files, this tends to create issues with a lot of common client tools, like MS Excel.
@danielbachhuber What's your take on this? Worth providing an optional argument to get the footer nevertheless?
A CSV file does not know the concept of a "footer". It is meant to provide the data in a format that can be easily imported into spreadsheets or other tools, and the convention is that it either contains pure data, with 1 single, optional header line.
Correct. This was the original design decision.
What's your take on this? Worth providing an optional argument to get the footer nevertheless?
It's fine to keep as-is.
@wpbullet If you pipe --format=table
output to a file, you'll notice it ends up in tab-delimited format which you can parse just like CSV. Alternatively, you can parse the CSV output and calculate totals yourself.
Thanks for chiming in! The problem with using --format=table
and something like column -t
is that when you redirect to a file the footer column has a blank column which gets skipped! I have patched it by replacing the empty row with a -
but it's far from pretty compared to if it was a csv.
I noticed today the
wp profile hook --all --spotlight
command is showing different outputwp profile hook --all --spotlight
Output
With format=csv the bottom total column is gone
wp profile hook --all --spotlight --format=csv
Output