Count line in analyses output

Hey!

I have analyses that give me output.
I’m want to count - how many line inside the output. (length is not good for me…)

for example:

Relevant:
if (exists wmi) then ((string value of property “HotFixID” of it) of select objects “HotFixID from Win32_QuickFixEngineering where HotFixID != ‘File 1’” of wmi) as string else (“N/A”)
Output:
KB2693643
KB5017262
KB5003791
KB5007401
KB5012170
KB5015684
KB5018410
KB5014035
KB5014671
KB5015895
KB5016705
KB5005699

But I’m want the output will be “12” ( bc 12 line).
This is possible?

Well, you’re not really counting “number of lines” (because this isn’t a file with lines in it), but “number of results”. If you still want to have the “N/A” as a possible result, you’ll need to cast that number of results to a string (so the then/else both return a String type).

Here you go…

q: if (exists wmi) then (it as string) of number of ((string value of property "HotFixID" of it) of select objects "HotFixID from Win32_QuickFixEngineering where HotFixID != 'File 1'" of wmi) as string else ("N/A")
A: 7
1 Like

Thanks you.
I’ll try it!