Maybe my title cannot fully explain my intention.
I have a list of data like below:
@HWI-ST150_0129:3:8:21208:93107#0/1
TGTCTAGTTTTTATAGGAAGATATTTCCTTTTCTACCTTTGACTTCAAAGCGGCTGAAATCTCCACTTGCAAATTCCACAAAAAGAGTGTTACAAGTCT
+
Yeeeeeeeeeceed]dddddd^YdceeeedaeeddYccccc\ddceeYeYY`[`bcYc^_XY^_]d^dd`abdddee\e\ddLb]`_`cTbbbYbaM_]
@HWI-ST150_0129:3:8:21208:93107#0/2
TTTGTAAAGTCTGCACGTGGATAACTTGACCACTTAGAGGCCTTCGTTGGAAACGGGTTTTTTTCATGTAAGGCTAGACAGAAGAATTCTCAGTAACTTCAAGTTACTGAGAATTCTTCTGTCTAGCCTTACATGAAAAAAACCCGTTTCCAACGAAGGCCTCTAAGTGGTCAAGTTATCCACGTGCAGACTTTACAAA
+
ffcaefffcdeeeeeeeeeedff^f`\\eeedaec^d^d`deaffeeTecb^bbbddadYcccW[X\MZ\XaU_UTI\]TZ]K[VQX^aIb`b`^X^YSYHWI-ST150_0129:3:8:21208:93107#0
We can see the first line and 5th line are both head/name, but ending with either #0/1 or #0/2. Now I hope to group every 4 lines, but later merge all those with #0/1 together, and #0/2 together.
Should be like:
@HWI....#0/1
TTCCGC
+
cffccc
@HWI....#0/1
CCGGGG
+
abbcgg
....
also another file is:
@HWI….#0/1
ATTCCG
+
fccfcc
@HWI….#0/1
CGCCGG
+
gbbcaa
I know how to do this with a simple python script. But just wondering if we can do only with some quite simple bash code?
Thanks
sed -n '1,${p;n;n;n;}'should work for getting every 4th line:Useful One-Line Scripts For
sedman sed