Using tuple on a file with multiple lines matching?

Q: lines of file "/opt/oracle/scripts/javaversion.info"
A: /opt/oracle/jrmc_backup_R28.2.2|1.6.0_29|Java(TM) SE Runtime Environment (build 1.6.0_29-b11)|Oracle JRockit(R) (build R28.2.2-7-148152-1.6.0_29-20111221-2104-linux-x86_64, compiled mode)|
A: /opt/oracle/jrmc|1.6.0_29|Java(TM) SE Runtime Environment (build 1.6.0_29-b11)|Oracle JRockit(R) (build R28.2.0-79-146777-1.6.0_29-20111005-1807-linux-x86_64, compiled mode)|
T: 185

returns 2 lines, but if I use the following to return only the first value, I only get one answer, but want all of them.

Q: (tuple string item 0 of concatenation ", " of substrings separated by "|" of lines of file "/opt/oracle/scripts/javaversion.info")
A: /opt/oracle/jrmc_backup_R28.2.2

How can I return the first value of each line of the file, separated by |

Thanks

What happens if you use …

 (tuple string items 0 of concatenation ", " of substrings separated by "|" of lines of file "/opt/oracle/scripts/javaversion.info")

Like this:

(preceding texts of firsts "|" of it) of lines of files "/opt/oracle/scripts/javaversion.info"

This is what you were trying to do: (but less efficient than the above)

(tuple string items 0 of concatenation ", " of substrings separated by "|" of it) of lines of file "/opt/oracle/scripts/javaversion.info"

Yes that works, but I also need to get values retied for second, third as well. Is the tuple property only work on single line of a file like in my example?

Even that returns a single value…

I’m not really sure what this means.

The relevance I provided should give the first part of both lines, not just a single value.

Can you provide the output you would like to see?

I just did some further testing, and both options I provided work to return the first value of both lines.


Is this what you were looking for?

concatenations ", " of (tuple string items 0 of concatenation ", " of substrings separated by "|" of it) of lines of files "/opt/oracle/scripts/javaversion.info"

Using the following in an analysis, but not always getting the values I expect, for example:

Q: (tuple string item 0 of concatenation ", " of substrings separated by “|” of it) of lines of file "/opt/oracle/scripts/javaversion.info"
A: /opt/oracle/jrmc_backup_R28.2.2
A: /opt/oracle/jrmc
T: 328

Q: (tuple string item 1 of concatenation ", " of substrings separated by “|” of it) of lines of file "/opt/oracle/scripts/javaversion.info"
A: 1.6.0_29
A: 1.6.0_29
T: 282

Q: (tuple string item 2 of concatenation ", " of substrings separated by “|” of it) of lines of file "/opt/oracle/scripts/javaversion.info"
A: Java™ SE Runtime Environment (build 1.6.0_29-b11)
A: Java™ SE Runtime Environment (build 1.6.0_29-b11)
T: 267

Q: (tuple string item 3 of concatenation ", " of substrings separated by “|” of it) of lines of file "/opt/oracle/scripts/javaversion.info"
A: Oracle JRockit® (build R28.2.2-7-148152-1.6.0_29-20111221-2104-linux-x86_64, compiled mode)
A: Oracle JRockit® (build R28.2.0-79-146777-1.6.0_29-20111005-1807-linux-x86_64, compiled mode)

The item 3 shows two output lines the same, but the file being read in is not…
Q: lines of file "/opt/oracle/scripts/javaversion.info"
A: /opt/oracle/jrmc_backup_R28.2.2|1.6.0_29|Java™ SE Runtime Environment (build 1.6.0_29-b11)|Oracle JRockit® (build R28.2.2-7-148152-1.6.0_29-20111221-2104-linux-x86_64, compiled mode)|
A: /opt/oracle/jrmc|1.6.0_29|Java™ SE Runtime Environment (build 1.6.0_29-b11)|Oracle JRockit® (build R28.2.0-79-146777-1.6.0_29-20111005-1807-linux-x86_64, compiled mode)|

I’m sorry, it is working as expected… Thanks for your help

1 Like

If you are okay with it only having a single result if all results are the same, to simplify reporting, you can do this:

unique values of (tuple string item 1 of concatenation ", " of substrings separated by "|" of it) of lines of file "/opt/oracle/scripts/javaversion.info"