Hi community!
Trying to figure out with the following taks:
I have source 2-dimensional array in VBS script, which i need to read in the loop and save only those records, which have the max TimeStamp per each Name:
Source:
Name | Type | TimeStamp |
Andrew | Type1 | 45678 |
Andrew | Type2 | 45679 |
Andrew | Type1 | 46678 |
Andrew | Type2 | 45660 |
Mike | Type3 | 6543 |
Mike | Type4 | 653 |
Tom | Type1 | 643 |
Expected array:
Name | Type | TimeStamp |
Andrew | Type1 | 46678 |
Mike | Type3 | 6543 |
Tom | Type1 | 643 |
I tried to use a classic way of fetching the max element using following code, but for not a bit confused how to apply it for 2-dim array:
Dim arr,max
arr=array(6,5,8,2,0,9)
max=arr(0)
for i=0 to ubound(arr)
if max< arr(i) then
max=arr(i)
end if
next
Thanks for your help!