On Fri, Jul 02, 2010 at 01:17:05AM +1000, Justin Clift wrote:
On 07/02/2010 01:11 AM, Richard W.M. Jones wrote:
<snip>
> The CSV format is rather underspecified as it is. csvtool was written
> based on what a certain popular spreadsheet can do, plus much folk
> wisdom. Changing the delimiter doesn't particularly help.
It seems like a really useful utility, useful in lots of situations. Is
it in RHEL (6) as well as Fedora?
Yes, in RHEL 6 (not in RHEL 5, but it is in EPEL). And Fedora and
Debian.
For the discussion here, kind of wondering what we can do to optimise
the CSV output? We don't know which utilities the user will have on
their system, and adding a hard dependency on csvtool may not be cool.
If you go down the CSV output path, then you have to accept that some
people may believe they can do:
virsh --csv ... | awk -F, '{ print $2 }'
and that this is going to Fail in a Bad Way for them at some point.
Furthermore they might not understand why it's bad, and may even
disagree with you on this.
What we did in the other virt-* tools that can generate CSV output is
to add very large warnings to the man pages and other documentation
which points to the right tools to use (not just csvtool, but using
the CSV libraries in your language of choice).
Whitespace-separated output, the original topic of this thread, is
still easier to parse from shell scripts given that you don't/can't
use any external tool. Provided the fields don't contain any internal
whitespace and are never empty.
Rich.
--
Richard Jones, Virtualization Group, Red Hat
http://people.redhat.com/~rjones
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine. Supports Linux and Windows.
http://et.redhat.com/~rjones/virt-df/