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 example would be if I exectued my script with 4TJW and have it return the info from user. So it would return test.

"user" "test" {
"name" = "test"
"princName" = "test@local"
"cn" = "test"
"ID" = 12345
"aSN" = "4TJW"
}

"user" "test2" {
"cn" = "test2"
"sAmname" = "test2"
"email" = "test2@corp.com"
"ID" = 422223
"aSN" = "TRI3"
}