regex - grepping using the "|" alternative operator -


the following sample of large file named at5g60410.gff:

chr5    tair10  gene    24294890    24301147    .   +   .   id=at5g60410;note=protein_coding_gene;name=at5g60410 chr5    tair10  mrna    24294890    24301147    .   +   .   id=at5g60410.1;parent=at5g60410;name=at5g60410.1;index=1 chr5    tair10  protein 24295226    24300671    .   +   .   id=at5g60410.1-protein;name=at5g60410.1;derives_from=at5g60410.1 chr5    tair10  exon    24294890    24295035    .   +   .   parent=at5g60410.1 chr5    tair10  five_prime_utr  24294890    24295035    .   +   .   parent=at5g60410.1 chr5    tair10  exon    24295134    24295249    .   +   .   parent=at5g60410.1 chr5    tair10  five_prime_utr  24295134    24295225    .   +   .   parent=at5g60410.1 chr5    tair10  cds 24295226    24295249    .   +   0   parent=at5g60410.1,at5g60410.1-protein; chr5    tair10  exon    24295518    24295598    .   +   .   parent=at5g60410.1 

i having trouble extracting specific lines using grep. wanted extract lines of type "gene" or type "exon", specified in third column. suprised when did not work:

grep 'gene|exon' at5g60410.gff 

no results returned. have gone wrong?

you need escape |. following should job.

grep "gene\|exon" at5g60410.gff 

Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -