Grep string and put in csv file Unix
<p>I have gz file that have some data now i want to grep two diffrent pattern and put that data into a csv file .For the same i want to write a shell script how can we do this please help me in this.</p>

<p>Below are the two command with i want to grep the data line by line and then put into a csv file .</p>

<p>Commands :</p>

<pre><code>zgrep "Time"  file.txt.gz
zgrep "requests" file.txt.gz
</code></pre>

<p>Please suggest how could i use these command in shell and get the data in a csv file </p>

<p>This is the output i am getting after doing :</p>

<pre><code>zgrep -E 'Time|requests' file.txt.gz

 Time 27-Apr-2016 07:24:15 CDT,
 requests currently being processed, 1 
  Time 27-Apr-2016 07:24:15 CDT,
 requests currently being processed, 2 ,
</code></pre>

<p>I want the ouput like <code>Time 27-Apr-2016 07:24:15 CDT | requests currently being processed, 1</code> </p>