Listing multiple values if a file

(imported topic written by SystemAdmin)

Hi,

I have a log file that has several patches, listed. I used the following the list the lines containing the patchs like this, but would like to get a listing of just the patch numbers

Q: lines whose (it contains "Patch ") of file “/opt/oracle/agent11g/lsinventory.log”

A: Patch 12351908 : applied on Sat Sep 10 10:33:17 CDT 2011

A: Patch 12796316 : applied on Sat Sep 10 10:32:59 CDT 2011

A: Patch 12775067 : applied on Sun Jul 31 10:55:19 CDT 2011

A: Patch 12606825 : applied on Sun Jul 31 10:55:16 CDT 2011

A: Patch 12425333 : applied on Sun Jul 31 10:54:27 CDT 2011

A: Patch 12425328 : applied on Sun Jul 31 10:54:24 CDT 2011

A: Patch 12425320 : applied on Sun Jul 31 10:54:21 CDT 2011

A: Patch 12424139 : applied on Sun Jul 31 10:54:16 CDT 2011

A: Patch 12596905 : applied on Sun Jul 31 10:53:27 CDT 2011

A: Patch 9345906 : applied on Sun Jul 31 10:52:44 CDT 2011

A: Patch 11774949 : applied on Sun Jul 31 10:51:57 CDT 2011

A: Patch 11710294 : applied on Sun Jul 31 10:51:16 CDT 2011

A: Patch 8240469 : applied on Sun Mar 27 08:44:06 CDT 2011

A: Patch 8685010 : applied on Sun Mar 27 08:43:55 CDT 2011

A: Patch 7568506 : applied on Sun Mar 27 08:43:51 CDT 2011

A: Patch 5336126 : applied on Sun Mar 27 08:43:44 CDT 2011

I tried this tuple command, but it only lists the first patch number, not all of them? What am I missing or is there another command

Q: tuple string item 2 of concatenations ", " of substrings separated by " " of lines whose ( it contains "Patch ") of file “/opt/oracle/agent11g/lsinventory.log”

A: 12351908

(imported comment written by jeremylam)

Since the format is pretty consistent, I would just check for text following “Patch” and before the “:” as follows:

q: (it as trimmed string) of (following texts of firsts 
"Patch" of preceding texts of firsts 
":" of (
"Patch  12351908     : applied on Sat Sep 10 10:33:17 CDT 2011";
"Patch  12796316     : applied on Sat Sep 10 10:32:59 CDT 2011";
"Patch  12775067     : applied on Sun Jul 31 10:55:19 CDT 2011";
"Patch  12606825     : applied on Sun Jul 31 10:55:16 CDT 2011";
"Patch  12425333     : applied on Sun Jul 31 10:54:27 CDT 2011";
"Patch  12425328     : applied on Sun Jul 31 10:54:24 CDT 2011";
"Patch  12425320     : applied on Sun Jul 31 10:54:21 CDT 2011";
"Patch  12424139     : applied on Sun Jul 31 10:54:16 CDT 2011";
"Patch  12596905     : applied on Sun Jul 31 10:53:27 CDT 2011";
"Patch  9345906      : applied on Sun Jul 31 10:52:44 CDT 2011";
"Patch  11774949     : applied on Sun Jul 31 10:51:57 CDT 2011";
"Patch  11710294     : applied on Sun Jul 31 10:51:16 CDT 2011";
"Patch  8240469      : applied on Sun Mar 27 08:44:06 CDT 2011";
"Patch  8685010      : applied on Sun Mar 27 08:43:55 CDT 2011";
"Patch  7568506      : applied on Sun Mar 27 08:43:51 CDT 2011";
"Patch  5336126      : applied on Sun Mar 27 08:43:44 CDT 2011")) A: 12351908 A: 12796316 A: 12775067 A: 12606825 A: 12425333 A: 12425328 A: 12425320 A: 12424139 A: 12596905 A: 9345906 A: 11774949 A: 11710294 A: 8240469 A: 8685010 A: 7568506 A: 5336126 I: plural string

(imported comment written by Ekkopto91)

similarly:

((preceding text of first " :" of following text of first "Patch " of it) of lines whose (it contains "Patch " )of it) of file “c:\text.txt”