X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=df%2Fvirt-df;h=78eb25c98ecd9068c86ddbdcf61dd5c72c9def5c;hb=9d25e82491ddcf495e1d30694327e4bfd3a23445;hp=21ba79177cd8f625b38628cd36dc10187c374a18;hpb=b488436cc54288fcae8988493749f2e6c87f274c;p=libguestfs.git diff --git a/df/virt-df b/df/virt-df index 21ba791..78eb25c 100755 --- a/df/virt-df +++ b/df/virt-df @@ -107,8 +107,9 @@ my $csv; =item B<--csv> -Write out the results in CSV format (comma-separated values). -This format can be imported easily into databases and spreadsheets. +Write out the results in CSV format (comma-separated values). This +format can be imported easily into databases and spreadsheets, but +read L below. =cut @@ -309,6 +310,30 @@ sub human_size } } +=head1 NOTE ABOUT CSV FORMAT + +Comma-separated values (CSV) is a deceptive format. It I like +it should be easy to parse, but it is definitely not easy to parse. + +Myth: Just split fields at commas. Reality: This does I work +reliably. This example has two columns: + + "foo,bar",baz + +Myth: Read the file one line at a time. Reality: This does I +work reliably. This example has one row: + + "foo + bar",baz + +For shell scripts, use C (L +also packaged in major Linux distributions). + +For other languages, use a CSV processing library (eg. C +for Perl or Python's built-in csv library). + +Most spreadsheets and databases can import CSV directly. + =head1 SEE ALSO L,