I need relevance to get each of the values. I can sort of work up some stuff to grab some but not all. anyone have some tricky trick way to get each one univerdally?
You want each value as a separate relevance statement individually?
This will fail if there is an empty line added to the beginning of the file, which may never happen. If the file is always 1 line long, then there is no need to reference line 1 specifically, but if it is a very large file, then limiting the relevance to the first few lines is a very good idea.
This is all of the values as a whole:
(it as trimmed string) of ( (following text of first "=" of it | it) of substrings separated by " " of it) of lines of files "c:\tmp\manifest.found"
I didnāt test this.
To get just the name, I would do it this way:
preceding texts of firsts " " of following texts of firsts "name=" of lines of files "c:\tmp\manifest.found"
If the as string is required:
preceding texts of firsts " " of following texts of firsts "name=" of (it as string) of lines of files "c:\tmp\manifest.found"
It is interesting how there are things like substrings between, after, before and preceding, following text
I think in some cases these are aliases of the same or similar thing. I donāt pay much attention to it and just get something to work but I should look into it more and figure out the differences⦠and if there is any speed difference.
Thereās a general regex used in the BESDownloadCacher tool that Iāve seen referenced somewhere, and I duplicate it in a custom download cacher that I wrote to only precache files from fixlets that are relevant in my environment. It parses all of the download, download now, download now as, prefetch, and add prefetch item statements from fixlet action scripts.
My Web Report runs this to identify the relevant downloads. A custom Web Report Archive Handler saves this to an output file, and I feed the file as an input to a curl script; this way I only precache the downloads that are relevant to at least one host in my environment.
For each download, Iām only preserving the expected sha1 and the URL; after each download I check the sha1 to ensure I have the correct file. The regex could be adapted to preserve the size and sha256 as well.
The normal BESDownloadCacher has two major limitations in my view - it downloads every file (relevant or not); and the method it uses to check whether a given file is already precached is very slow (for every file download, it retrieves a list of every file from sha1 and compares, which takes several hours with a large cache).
concatenation "%0d%0a" of unique values of (item 0 of it & ", " & item 1 of it) of (parenthesized parts 2 of matches (case insensitive regex "(sha1:|sha1=)([^[:space:]]+)") of it , matches (case insensitive regex "((mailto\:|(news|(ht|f)tp(s?))\:\/\/){1}\S+)") of it)of ((matches (case insensitive regex "^[[:space:]]*(download|prefetch|download now|download now as|add prefetch item).*$") whose (it does not contain "MANUAL_BES_CACHING_REQUIRED" and it does not contain "127.0.0.1:52311/" and it does not contain "downloadserver:52311/" )of substrings separated by "%0a" of scripts of actions whose (exists script whose (exists matches (case insensitive regex "((mailto\:|(news|(ht|f)tp(s?))\:\/\/){1}\S+)") of it) of it) of it) as string) of fixlets whose ((fixlet flag of it or task flag of it) AND applicable computer count of it > 0) of bes sites whose (external site flag of it or custom site flag of it)
I think for parsing your file it would be something like
(parenthesized parts 2 of matches (case insensitive regex "(sha1:|sha1=)([^[:space:]]+)") of it , parenthesized parts 2 of matches (case insensitive regex "(name:|name=)([^[:space:]]+)") of it ) of lines of file "X"
where āitem 0ā will give the sha1, āitem 2ā will give the name, and you can duplicate those as needed to get URL, size, and (if present) the sha256 values.