I can gzip an awk output like this:
echo "col1 col2" | awk '{print $1}' | gzip > out
But is it also possible to pipe two awk output file streams to gzip? This doesn't work:
echo "col1 col2" | awk '{print $1 | gzip > "out1.gz"; print $2 | gzip > "out2.gz"}'
Using awk, it can handle more columns easily.
echo "col1 col2" | awk '{for (i=1;i<=NF;i++) print $i | "gzip > out" i ".gz"}'
It is, and I found the correct syntax, when searching for awk pipe output:
echo "col1 col2" | awk '{print $1 | "gzip > out1.gz"; print $2 | "gzip > out2,gz"}'