I am trying to use SED command to replace/remove rs numbers from my file.
I have a VCF file:
##reference=file:/hs37d5.fasta
#CHROM POS ID REF ALT QUAL FILTER INFO FORMAT SC_PCHD5235298
1 10234 rs145599635 C T 153.34 .
I would like to replace rs* entries ONLY on the lines which does not start with #,
For example i would like to replace rs145599635 with a dot. And want it to ignore headers which are the lines start with a #.
I tried
sed "/^[^#]/s/rs.*/./g" test.vcf
but it deletes everything after the rs.
You can try with this,
Ex:
I altered your command.You have to write like this.
My test.vcf file looks like this.I think your file looks like this only.
I hope this will help you.