/data/MGI2000/V350200125/L04/V350200125_L04_undecoded_1.fq.gz

TAACACGACGCGTCGATGAC
TGTTCTCTTCATATAAGGCG
CAGATCATTTATTTTCTCGC

barcodes.txt
CTAATAACTTAT
paste <(zcat /data/MGI2000/V350200125/L04/V350200125_L04_undecoded_1.fq.gz|paste - - - -) <(zcat /data/MGI2000/V350200125/L04/V350200125_L04_undecoded_2.fq.gz|paste - - - - )| \
awk -v FS="\t" -v OFS="\n" 'FNR==NR {samples[$2]=$1; next} {barcode = substr($6,0,8); if(samples[barcode]) { print $1,$2,$3,$4>>samples[barcode]"_1.fastq"; print $5,$6,$7,$8>>samples[barcode]"_2.fastq"}}' samples.txt -

paste <(zcat /data/MGI2000/V350200125/L04/V350200125_L04_undecoded_1.fq.gz|paste - - - -) <(zcat /data/MGI2000/V350200125/L04/V350200125_L04_undecoded_2.fq.gz|paste - - - - )| \
awk -v FS="\t" -v OFS="\n" 'BEGIN { myArray["TAACACGACGCGTCGATGAC"] = 385 ; myArray["TGTTCTCTTCATATAAGGCG"] = 386;}{barcode=substr($6,151,170); if(myArray[barcode]) print $1,$2,$3,$4>>myArray[barcode]"_1.fastq"; print $5,$6,$7,$8>>myArray[barcode]"_2.fastq" }'  -



awk -v FS="\t" -v OFS="\n" 'BEGIN { myArray["TAACACGACGCGTCGATGAC"] = 385 ; myArray["TGTTCTCTTCATATAAGGCG"] = 386;barcode="TGTTCTCTTCATATAAGGCG" ;if(myArray[barcode]) print myArray[barcode]; }' samples.txt -

paste <(zcat /data/MGI2000/V350200125/L04/V350200125_L04_undecoded_1.fq.gz|paste - - - -) <(zcat /data/MGI2000/V350200125/L04/V350200125_L04_undecoded_2.fq.gz|paste - - - - )| \
    awk -v FS="\t" -v OFS="\n"  '{ barcode = substr($6,0,8); print $barcode }' samples.txt   -


paste <(zcat /data/MGI2000/V350200125/L04/V350200125_L04_undecoded_1.fq.gz|paste - - - -) <(zcat /data/MGI2000/V350200125/L04/V350200125_L04_undecoded_2.fq.gz|paste - - - - )| \
awk 'BEGIN { myArray["TAACACGACGCGTCGATGAC"] = 385 ; myArray["TGTTCTCTTCATATAAGGCG"] = 386;barcode="TGTTCTCTTCATATAAGGCG" ;if(myArray[barcode]) print myArray[barcode]; }'