What would be the best way to query and print info from a text file using a certain keyword?

As an example if I wanted to query the aSN field of a text file and print out the username.

So an...