I have a file that has this type of data in it...
Sample Code:
T1 7/0:
DS0's Active: 22
DS0's Active High Water Mark: 23
TimeSlot Type TotalCalls TotalDuration
1 pri 157 00:08:48
2 pri 129 01:06:24
3 pri 115 00:00:51
4 pri 124 00:02:57
5 pri 123 00:28:56
6 pri 126 00:08:48
7 pri 117 00:06:52
8 pri 97 00:00:21
9 pri 157 00:00:44
10 pri 111 00:10:56
11 pri 112 00:09:12
12 pri 120 00:05:03
13 pri 118 00:19:17
14 pri 107 00:02:30
15 pri 101 00:00:37
16 pri 124 00:04:26
17 pri 115 00:06:31
18 pri 108 00:34:02
19 pri 122 00:23:41
20 pri 120 00:02:43
21 pri 111 00:07:55
22 pri 145 00:06:46
23 pri 101 00:09:59
24 pri-sig 0 00:00:00
I want to build any array that will assign the Timeslot value and the TotalCalls Value to an array.
This is the code that I was attempting to use
Code:
Function Calc ($Name)
DIM $Total, $out[], $Read, $R, $Counter, $TS
$Total = 0
;Note = Array $CountTotal each element is equeal to the following list
; 0 = COX
; 1 = ACD Rolm
; 2 = ADOA
; 3 = Admin Rolm
; 4 = 12th Street
; 5 = Qwest
; 6 = Admin Down
; 7 = Not Defined
Open (1, "c:\tftp-root\recieve\"+$Name+"_CallCount.txt", 2)
For $Counter = 0 To 7
$R = ReadProfileString("C:\bin\t1des.ini", $Name, $Counter)
$Read = ReadLine(1)
While @ERROR = 0
If $Counter+":" = Right($Read,2)
$TS = ReadLine(1)
While @ERROR = 0
$Out = Split($TS, " ")
If UBound($out) => 23
Select
Case $Out[6] = 0
$Total = $Total + $Out[23]
Case $Out[6] = 1
$total = $total + $out[23]
Case $Out[6] = 2
$total = $total + $out[23]
Case $Out[6] = 3
$total = $total + $out[23]
Case $Out[6] = 4
$total = $total + $out[23]
Case $Out[6] = 5
$total = $total + $out[23]
Case $Out[6] = 6
$total = $total + $out[23]
Case $Out[6] = 7
$total = $total + $out[23]
Case $Out[6] = 8
$total = $total + $out[23]
Case $Out[6] = 9
$total = $total + $out[23]
Case $Out[5] = 10
$total = $total + $out[23]
Case $Out[5] = 11
$total = $total + $out[23]
Case $Out[5] = 12
$total = $total + $out[23]
Case $Out[5] = 13
$total = $total + $out[23]
Case $Out[5] = 14
$total = $total + $out[23]
Case $Out[5] = 15
$total = $total + $out[23]
Case $Out[5] = 16
$total = $total + $out[23]
Case $Out[5] = 17
$total = $total + $out[23]
Case $Out[5] = 18
$total = $total + $out[23]
Case $Out[5] = 19
$total = $total + $out[23]
Case $Out[5] = 20
$total = $total + $out[23]
Case $Out[5] = 21
$total = $total + $out[23]
Case $Out[5] = 22
$total = $total + $out[23]
Case $Out[5] = 23
$total = $total + $out[23]
Case $Out[5] = 24
$total = $total + $out[23]
EndSelect
EndIf
$TS = ReadLine(1)
Loop
Select
Case $R = "Cox"
$CountTotal[0] = $CountTotal[0] + $Total
Case $R = "ACD_Rolm"
$Counttotal[1] = $CountTotal[1] + $Total
Case $R = "ADOA"
$Counttotal[2] = $CountTotal[2] + $Total
Case $R = "Admin_Rolm"
$Counttotal[3] = $CountTotal[3] + $Total
Case $R = "12th_Street"
$Counttotal[4] = $CountTotal[4] + $Total
Case $R = "Qwest"
$Counttotal[5] = $CountTotal[5] + $Total
Case $R = "Admin_Down"
$Counttotal[6] = $CountTotal[6] + $Total
Case $R = ""
$Counttotal[7] = $CountTotal[7] + $Total
EndSelect
EndIf
$Read = ReadLine(1)
Loop
ReDIM $Total
Next
Close(1)
Open (1, "c:\tftp-root\recieve\"+$Name+"_CallCount.txt", 4)
WriteLine(1, @CRLF)
WriteLine(1, "Count total for Cox circuits: "+$CountTotal[0]+@CRLF)
WriteLine(1, "Count total for ACD Rolm circuits: "+$CountTotal[1]+@CRLF)
WriteLine(1, "Count total for ADOA circuits: "+$CountTotal[2]+@CRLF)
WriteLine(1, "Count total for Admin Rolm circuits: "+$CountTotal[3]+@CRLF)
WriteLine(1, "Count total for 12th Street circuits: "+$CountTotal[4]+@CRLF)
WriteLine(1, "Count total for Qwest circuits: "+$CountTotal[5]+@CRLF)
WriteLine(1, "Count total for Admin Down circuits: "+$CountTotal[6]+@CRLF)
WriteLine(1, "Count total for Undefined circuits: "+$CountTotal[7]+@CRLF)
Close (1)
EndFunction
I am just not getting how to grab a "right justified" value from a text file.
As alway's many thanks for your help.