<p>Haven't tried, but I believe you may add <code>-Z</code> to fasterq-dump and remove <code>-k ${i}</code> from gzip. In addition, I would recommend the following:</p>
<pre class="lang-sh prettyprint-override"><code>cat SRR_Acc_List.txt | xargs -i echo fasterq-dump {} --split-spot -Z -v --skip-technical -e 15 \| gzip &gt; {}.gz | sh
</code></pre>
<p>It is simpler and more flexible. For example, replacing <code>sh</code> with <code>parallel</code> would allow you to download in parallel.</p>

CC BY-SA 4.0
2023-06-08T13:26:53.297Z
2023-06-08T13:26:53.297Z
user172818
<p>I tried this and it worked</p>
<pre><code>cat SRR_Acc_List.txt | while read i ; do  fasterq-dump ${i} --split-spot -v --skip-technical  -e 20 ; for j in i ; do   gzip ${i}.fastq  ; done; done
</code></pre>

CC BY-SA 4.0
2023-06-12T09:11:52.670Z
2023-06-12T19:33:32.853Z
2023-06-12T19:33:32.853Z
Shradha Sharma
<p>I want to zip the files generated by fasterq-dump simultaneously as they are generated. The code that I tried is this.</p>
<pre><code>cat SRR_Acc_List.txt | while read i 
do  fasterq-dump ${i} --split-spot -v --skip-technical  -e 15| gzip -k  ${i}&gt; ${i}.gz 
done
</code></pre>

<ncbi><sra>
ZIP the fasterq-dump files in loop
# ZIP the fasterq-dump files in loop

(Asked by: username_0 on 2023-06-08)

I want to zip the files generated by fasterq-dump simultaneously as they are generated. The code that I tried is this.
cat SRR_Acc_List.txt | while read i 
do  fasterq-dump ${i} --split-spot -v --skip-technical  -e 15| gzip -k  ${i}> ${i}.gz 
done

**Tags:** ncbi, sra

---

## 2 answers

### Answer by username_1 on 2023-06-08. Score: 1

Haven't tried, but I believe you may add -Z to fasterq-dump and remove -k ${i} from gzip. In addition, I would recommend the following:
cat SRR_Acc_List.txt | xargs -i echo fasterq-dump {} --split-spot -Z -v --skip-technical -e 15 \| gzip > {}.gz | sh

It is simpler and more flexible. For example, replacing sh with parallel would allow you to download in parallel.


---

### Answer by username_0 on 2023-06-12. Score: 1

I tried this and it worked
cat SRR_Acc_List.txt | while read i ; do  fasterq-dump ${i} --split-spot -v --skip-technical  -e 20 ; for j in i ; do   gzip ${i}.fastq  ; done; done


---

