I have a .txt file with multiple lines that gives amino acid and residue data. The data looks like this:
ARG262-Side ASP368-Side 140,83% ARG95-Side GLU107-Side 103,73% ARG474-Side VAL468-Main 94,93% PHE169-Main ALA190-Main 94,63% THR205-Side ASP203-Side 94,07% ILE299-Main LYS249-Main 94% LEU354-Main LYS365-Main 93,6% ARG346-Side GLU263-Side 93,57% LEU301-Main ALA247-Main 93,43% ALA190-Main PHE169-Main 93,37% SER252-Side ASP296-Side 93,1% TYR424-Side ASN446-Main 93%
I can roughly say that the numbers indicate residues and the letters indicate aminoacids. So, both in the first and second field of each line, the part before the
- consists of an aminoacid identifier and a residue value. I want to print only lines where the see residue value lies in a certain range, regardless of amino acid, and regardless of whether the first or second field matches the criterion.
For example, from the above input file, I want to extract data that contains only residues between 300-425. In this case, my output should look like this:
ARG262-Side ASP368-Side 140,83% LEU354-Main LYS365-Main 93,6% ARG346-Side GLU263-Side 93,57% LEU301-Main ALA247-Main 93,43% TYR424-Side ASN446-Main 93%
I tried using the
grep command for this, but I wasn't very successful. Is there a command I can use other than