2

I have a file with 2 columns:

head positions_vcf
4 68264840
4 52784678
4 52788987
4 52795404
4 52800097
4 52801203
4 52804052
4 52804766
4 52804941
4 52805425
4 52807245
4 52809203
4 52809705
4 52810211
4 52810307
4 52811970
4 52812994
4 52814042
4 52814185
4 52815272

I need to select only rows in which the second column is within the range of "52804760-52809700". my desired out_put

desired_output
4 52804766
4 52804941
4 52805425
4 52807245
4 52809203

1 Answer 1

3

Using awk:

awk '$2 >= 52804760 && $2 <= 52809700' positions_vcf
2
  • 2
    or more awk-ishly: awk '$2 >= 52804760 && $2 <= 52809700'
    – Jeff Schaller
    Commented May 3, 2018 at 17:16
  • 1
    For readability, I like to use this style: 52804760 <= $2 && $2 <= 52809700 Commented May 3, 2018 at 17:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .