X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=tools%2Fvirt-ifconfig.pl;h=41971532625807c6ae26a0f67d0633b370b617dd;hb=854f4c38777ebb2527757d1a585774b0c856efa3;hp=74346a61dd3056fc3e06f2f148405e2b3e62f9c9;hpb=3fdc8cc9b53be241cd636cafd4ecce4111f62b05;p=virt-tools.git diff --git a/tools/virt-ifconfig.pl b/tools/virt-ifconfig.pl index 74346a6..4197153 100755 --- a/tools/virt-ifconfig.pl +++ b/tools/virt-ifconfig.pl @@ -83,8 +83,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. =back @@ -214,13 +215,37 @@ sub do_ifconfig } } else { print STDERR - __x("{n}: no IP address found (is guest running virt-tools?)\n", + __x("{n}: no IP address found (is it running virt-tools-guest?)\n", n => $args[0]); } } exit 0; +=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,