<p>I want to format the output of the following command:</p>

<pre><code>kubectl config get-contexts
</code></pre>

<p>so add a delimiter so i can parse it, i've tried YAML And Json but they aren't supported.</p>

<p>How can I format the data to be as follows:</p>

<pre><code>CURRENT,NAME,CLUSTER,AUTHINFO,NAMESPACE,
,name1,cluster1,,clusterUser,,
*,name2,cluster2,clusterUser,,
</code></pre>

<p>You can use linux <code>sed</code> to rearrange the data to be as follows:</p>

<pre><code>[root@]# kubectl config get-contexts | tr -s " " | sed -e "s/ /,/g"
CURRENT,NAME,CLUSTER,AUTHINFO,NAMESPACE
*,kubernetes-admin@kubernetes,kubernetes,kubernetes-admin,
</code></pre>
