1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
| Set objFso = CreateObject("Scripting.FileSystemObject")
Set objInfoFile = objFso.OpenTextFile("C:\Documents and Settings\All Users\Documents\rapport.txt", 1)
Dim arrUsers ()
ReDim arrUsers(7, 0)
Do While Not objInfoFile.AtEndOfStream
arrTemp = Split(objInfoFile.ReadLine)
i = 0
boolUserFind = False
If arrTemp(6) = arrUsers(0, i) Then boolUserFind = True
Do While boolUserFind = False AND i < Ubound(arrUsers, 2)
i = i + 1
If arrTemp(6) = arrUsers(0, i) Then boolUserFind = True
Loop
If boolUserFind = True Then
arrUsers(1, i) = CInt(arrUsers(1, i)) + CInt(arrTemp(2))
arrUsers(2, i) = CInt(arrUsers(2, i)) + CInt(arrTemp(4))
Else
Redim Preserve arrUsers (7, Ubound(arrUsers, 2) + 1)
arrUsers(0, Ubound(arrUsers, 2) - 1) = arrTemp(6)
arrUsers(1, Ubound(arrUsers, 2) - 1) = arrTemp(2)
arrUsers(2, Ubound(arrUsers, 2) - 1) = arrTemp(4)
End If
Loop
Redim Preserve arrUsers (7, Ubound(arrUsers, 2) - 1)
strTemp = ""
For i = 0 To Ubound(arrUsers, 2)
If Len(arrUsers(1, i)) = 1 Then
M = "0000" & arrUsers(1, i)
End If
If Len(arrUsers(1, i)) = 2 Then
M = "000" & arrUsers(1, i)
End If
If Len(arrUsers(1, i)) = 3 Then
M = "00" & arrUsers(1, i)
End If
If Len(arrUsers(1, i)) = 4 Then
M = "0" & arrUsers(1, i)
End If
If Len(arrUsers(1, i)) = 5 Then
M = arrUsers(1, i)
End If
If Len(arrUsers(2, i)) = 1 Then
N = "0000" & arrUsers(2, i)
End If
If Len(arrUsers(2, i)) = 2 Then
N = "000" & arrUsers(2, i)
End If
If Len(arrUsers(2, i)) = 3 Then
N = "00" & arrUsers(2, i)
End If
If Len(arrUsers(2, i)) = 4 Then
N = "0" & arrUsers(2, i)
End If
If Len(arrUsers(2, i)) = 5 Then
N = arrUsers(2, i)
End If
strTemp =strTemp & arrUsers(0, i) & vbTab & M & " " & "min" & vbTab & N & " " & "photos" & vbnewline
Next
Set Fso = CreateObject("Scripting.FileSystemObject")
Set f = Fso.OpenTextFile("C:\Documents and Settings\All Users\Documents\totalclients.txt", 2)
f.Write (strTemp)
WScript.Echo strTemp |
Partager