19.4 CSV Pretty Print Output

20220112

Pretty print the output using --opprint.

$ mlr --icsv --opprint cat example.csv
color  shape    flag index quantity rate
yellow triangle 1    11    43.6498  9.8870
red    square   1    15    79.2778  0.0130
...

Pretty print the output as a table using --barred.

$ mlr --icsv --opprint --barred cat example.csv
+--------+----------+------+-------+----------+--------+
| color  | shape    | flag | index | quantity | rate   |
+--------+----------+------+-------+----------+--------+
| yellow | triangle | 1    | 11    | 43.6498  | 9.8870 |
| red    | square   | 1    | 15    | 79.2778  | 0.0130 |
| red    | circle   | 1    | 16    | 13.8103  | 2.9010 |
| red    | square   | 0    | 48    | 77.5542  | 7.4670 |
| purple | triangle | 0    | 51    | 81.2290  | 8.5910 |
| red    | square   | 0    | 64    | 77.1991  | 9.5310 |
| purple | triangle | 0    | 65    | 80.1405  | 5.8240 |
| yellow | circle   | 1    | 73    | 63.9785  | 4.2370 |
| yellow | circle   | 1    | 87    | 63.5058  | 8.3350 |
| purple | square   | 0    | 91    | 72.3735  | 8.2430 |
+--------+----------+------+-------+----------+--------+


Your donation will support ongoing availability and give you access to the PDF version of this book. Desktop Survival Guides include Data Science, GNU/Linux, and MLHub. Books available on Amazon include Data Mining with Rattle and Essentials of Data Science. Popular open source software includes rattle, wajig, and mlhub. Hosted by Togaware, a pioneer of free and open source software since 1984. Copyright © 1995-2022 Graham.Williams@togaware.com Creative Commons Attribution-ShareAlike 4.0