Trimming sequences based on specific pattern

My files look like this

And I need to cut the sequences at the last "A" found in the following 'pattern' -highlighted for easier identification, the pattern is the actual file is not highlighted.

The expected result should look like this

Thus, all the sequences would end with AGCCCTA but whatever is to the left of that particular pattern and the identifiers (>GHXCZCC01AJ8CJ) should be kept intact.
Thanks in advance

Hi Xterra, try this:

sed 's/\(.*AGCCCTA\).*/\1/' infile
1 Like

It works like a charm!
Thanks once again!