Many ESXCLI commands generate output you might want to use in your application. You can run esxcli with the --formatter dispatcher option and send the resulting output as input to a parser.

The --formatter options supports three values - csv, xml, and keyvalue and is used before any namespace.

The following example lists all file system information in CSV format.

esxcli --formatter=csv storage filesystem list

You can pipe the output to a file.

esxcli --formatter=keyvalue storage filesystem list > myfilesystemlist.txt

You should always use a formatter for consistent output.