{"id":1024,"date":"2020-04-18T19:16:23","date_gmt":"2020-04-18T19:16:23","guid":{"rendered":"https:\/\/jan.schnasse.org\/blog\/?p=1024"},"modified":"2026-09-28T11:38:46","modified_gmt":"2026-09-28T09:38:46","slug":"output-input-v0-1","status":"publish","type":"post","link":"https:\/\/jan.schnasse.org\/blog\/2020\/04\/18\/output-input-v0-1\/","title":{"rendered":"A tool to convert CSV, YML, XML, JSON and JSON-LD &#8211; oi v0.1"},"content":{"rendered":"<p><a href=\"https:\/\/github.com\/jschnasse\/oi\">First release of <strong><em>oi <\/em><\/strong><\/a>is ready for testing. <strong><em>oi<\/em><\/strong> is an experimental command line tool to convert structured data from one format into another. The first release comes with rudimentary support for CSV, JSON, XML, YML and JSON-LD. The basic idea is to provide a straight in-out\/out-in command that might not work completely correct but complements with other tools (jq, xsltproc,\u00a0 sed, grep, awk, etc. ) to manipulate structured data on the command line.<\/p>\n<h1>Install<\/h1>\n<pre><code>wget https:\/\/schnasse.org\/deb\/oi_0.0.1.deb\nsudo apt install .\/oi_0.0.1.deb # installs openjdk-11-jre\n<\/code><\/pre>\n<h1>Example Usage<\/h1>\n<ol>\n<li>Convert <code>passwd<\/code> to <code>yml<\/code> (use <code>-t<\/code> to print different formats)<\/li>\n<\/ol>\n<pre><code>oi \/etc\/passwd -d\":\" --header=\"login,password,uid,gid,comment,home,shell\" -icsv\n<\/code><\/pre>\n<ol start=\"2\">\n<li>List some disk info in <code>yml<\/code> (use <code>-t<\/code> to print different formats)<\/li>\n<\/ol>\n<pre><code>lsblk |grep -o sd.*|awk '{print $1 \";\" $4 \";\" $NF}'|oi -d\";\" --header=\"device,size,mount\" -icsv\n<\/code><\/pre>\n<ol start=\"3\">\n<li>Create adhoc Json-Ld Context for some arbitrary Json-API<\/li>\n<\/ol>\n<pre><code>curl https:\/\/api.github.com\/users\/jschnasse|oi -ijson -tcontext\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>First release of oi is ready for testing. oi is an experimental command line tool to convert structured data from one format into another. The first release comes with rudimentary support for CSV, JSON, XML, YML and JSON-LD. The basic idea is to provide a straight in-out\/out-in command that might not work completely correct but [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,9],"tags":[],"class_list":["post-1024","post","type-post","status-publish","format-standard","hentry","category-development","category-java"],"_links":{"self":[{"href":"https:\/\/jan.schnasse.org\/blog\/wp-json\/wp\/v2\/posts\/1024","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jan.schnasse.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jan.schnasse.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jan.schnasse.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jan.schnasse.org\/blog\/wp-json\/wp\/v2\/comments?post=1024"}],"version-history":[{"count":1,"href":"https:\/\/jan.schnasse.org\/blog\/wp-json\/wp\/v2\/posts\/1024\/revisions"}],"predecessor-version":[{"id":4194,"href":"https:\/\/jan.schnasse.org\/blog\/wp-json\/wp\/v2\/posts\/1024\/revisions\/4194"}],"wp:attachment":[{"href":"https:\/\/jan.schnasse.org\/blog\/wp-json\/wp\/v2\/media?parent=1024"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jan.schnasse.org\/blog\/wp-json\/wp\/v2\/categories?post=1024"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jan.schnasse.org\/blog\/wp-json\/wp\/v2\/tags?post=1024"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}