title: Unix: How to combine separate columns into one column
body: <p>I created a script that logs if an email is sent if it satisfies a condition.</p>
  <p>I get the output below using AWK to get specific columns.</p>
  <p>[AUTORESTART] Mar 17 21:21:32 GMT 2022</p>
  <p>I want to convert them to csv so I use below command</p>
  <pre><code>cat logchkmail_all.txt | awk '{print $4,$6,$7,$8,$9,$10}' | awk 'NR&gt;1{$1=$1}1' OFS=&quot;,&quot; &gt; sample.csv
  </code></pre>
  <p>...which works, but it returns</p>
  <p>[AUTORESTART],Mar,17,21:21:32,GMT,2022</p>
  <p>as it should. But what I want is to be able to separate the [AUTORESTART] and then combine columns 6-10 so that it would just have a total of 2 columns, one with [AUTORESTART] and the other &quot;Mar 17 21:21:32 GMT 2022&quot; as one column.</p>
  <p>Is there a way to do this?</p>