What my second solution does is printing out the field whose last characters correspond (in lowercase) to the characters at the end of the line.
So if a line has "AQM" in its last field my code searches and displays (if found) the field of this line which ends in "aqm", e. g. "Example%%%--14986.aqm".

While my first solution is limited to "AQM" and "MTF" and is depending on exact field positions my second solution can work with any character string found in the last field of the input line to search for any field with a matching (lowercase) ending.

If this field ending can be lowercase or uppercase (instead of always lowercase) try this:

I hope I explain this correctly. It seems my data has tab space versus the data your using.
I can press my right arrow key 6 times between (.alo - - - - - -TFR) the data your using but my data
I press the right arrow 1 time and I'm at the final String. (.alo-TFR)

Featured Post

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

If you want to move up through the ranks in your technology career, talent and hard work are the bare necessities. But they aren’t enough to make you stand out.
Expanding your skills, actively promoting your accomplishments and using promotion st…

Learn how to find files with the shell using the find and locate commands.
Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…