How to find sample IDs from publicly available fastq.gz

Hello qiime people,

I have a question I seem to not be able to find an answer to. I have a large fish gut microbiome dataset and I want to print out a list of unique feature ids for 2 metadata categorial variables. There are 20 levels of factor 1 and 3 levels of factor 2 resulting in 60 lists that I need. My end goal is to make 20 Venn diagrams based on factor 2... I apologize in advance if this is confusing to understand as I myself am struggling to describe this in plain English.

But long story there a way to print out feature ids in the terminal based on a table.qza? Even better, would I be able to print out a list based on a metadata variable(s)? I am selfishly trying to not have to do this in R or manually by downloading all the repseq tsv files...
Any help would be appreciated.