Looking for 1st occurance of line that contains "JAVA_HOME" of file

My analyst currently has the following property:

(following text of first "JAVA_HOME=" of it as trimmed string) of lines whose ( it contains "JAVA_HOME=" ) of file "/opt/anthill3/agent/bin/ah3agent"

It’s returning multiple lines that have “JAVA_HOME”

If they are all the same value, you can collapse it like this:

unique values of (it as trimmed string) of following texts of firsts "JAVA_HOME=" of lines whose ( it contains "JAVA_HOME=" ) of files "/opt/anthill3/agent/bin/ah3agent"

Also, is there a character that denotes a comment so that those lines can be excluded?


This is one way you can get the first value only:

tuple string items 0 of concatenations ", " of (it as trimmed string) of following texts of firsts "JAVA_HOME=" of lines whose ( it contains "JAVA_HOME=" ) of files "/opt/anthill3/agent/bin/ah3agent"

This method depends on there not being a comma followed by a space in the actual values.