Hello,
I already asked the question the comments of my last question : link to last question
But I think the question warrents its own post.
I am using the following command to detect missing values in REF:
bcftools norm --check-ref w --fasta-ref in.fa
I want to save the result of the analysis in a txt-file. I want to creat a loop later which takes multiple gvcf files and detects missing values in every REF-Column. The results of all files should be than exported to one txt-file.
I grepl the last line containing the analysis-results using grep:
grep "Lines total/split/realigned/skipped"
and add the output to a txt-file instead of printing it in terminal:
bcftools norm --check-ref w --fasta-ref in.fa input.g.vcf.gz | grep "Lines total/split/realigned/skipped" >> missing_data.txt
I also tried tree, > and 2>&1.
Nothing worked.
Is there a better way to 1. grep the last line and 2. export the analysis-results to txt.
If you already asked it, why ask a new question instead of just waiting for a response?