title: grep -f on files in a zipped folder
body: <p>I am performing a recursive fgrep/grep -f search on a zipped up folder using the following command in one of my programs:</p>
  <p><strong>The command I am using</strong>:</p>
  <pre><code>grep -r -i -z -I -f /path/to/pattern/file /home/folder/TestZipFolder.zip
  </code></pre>
  <p>Inside the pattern file is the string &quot;Dog&quot; that I am trying to search for.</p>
  <p>In the zipped up folder there are a number of text files containing the string &quot;Dog&quot;.</p>
  <p>The grep -f command successfully finds the text files containing the string &quot;Dog&quot; in 3 files inside the zipped up folder, but it prints the output all on one line and some strange characters appear at the end i.e PK (as shown below). And when I try and print the output to a file in my program other characters appear on the end such as <code>^B^T^@</code></p>
  <p><strong>Output from the grep -f command:</strong></p>
  <pre><code>TestZipFolder/test.txtThis is a file containing the string DogPKtest1.txtDog, is found again in this file.PKTestZipFolder/another.txtDog is written in this file.PK 
  </code></pre>
  <p>How would I get each of the files where the string &quot;Dog&quot; has been found to print on a new line so they are not all grouped together on one line like they are now?
  Also where are the &quot;PK&quot; and other strange characters appearing from in the output and how do i prevent them from appearing?</p>
  <p><strong>Desired output</strong></p>
  <pre><code>TestZipFolder/test.txt:This is a file containing the string Dog
  TestZipFolder/test1.txt:Dog, is found again in this file
  TestZipFolder/another.txt:Dog is written in this file
  </code></pre>
  <p>Something along these lines, whereby the user is able to see where the string can be found in the file (you actually get the output in this format if you run the grep command on a file that is not a zip file).</p>